Hello !
When using the AssetRegsitry with the Android PIE, it isn’t working. When using classic (i.e. windows) PIE, it works. I need it for finding maps and textures at runtime.
Here is my code (working on windows PIE):
bool AMainMenuGameMode::IsValidMap(FString Path)
{
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>("AssetRegistry"); // Initial AssetRegistryModule
TArray<FAssetData> AssetData; // Found assets Array declaration
FARFilter Filter; // Assets search filter declaration
Filter.ClassNames.Add(FName(*UWorld::StaticClass()->GetName())); // Search only for maps...
Filter.PackagePaths.Add("/Game/Maps"); //...only in the Maps folder
AssetRegistryModule.Get().GetAssets(Filter, AssetData); // Perform the search
UE_LOG(MenuGMLog, Log, TEXT("Assets found count : %d"), AssetData.Num());
for (auto it : AssetData) // For each found map...
if (it.PackageName.ToString() == Path) //...if the map's path is equal to the path passed in parameter...
return true; //...return true to notify this.
return false; // But if no path corresponds to the parameter, return false.
}
It logs Assets found count : 0, and returns false even if the path exists
Is it a bug, or a mistake from me? (Using UE4.7.6 built from github)
PS: Sorry for my bad english