Dear friends.
I’m working on asyncronous loading on my project with following tutorial.
And my code example is
void AMyLoader::BeginPlay() {
...
FStreamableManager& assetLoader = UNVInGameManager::Get().assetLoader;
TArray<FStringAssetReference> ItemsToStream;
for (int i = 0; i < tileDataNames.Num(); ++i) {
FString contextString;
FNVTileMetaData* data = tileDataTable->FindRow<FNVTileMetaData>(tileDataNames[i], contextString, true);
UE_LOG(LogTemp, Warning, TEXT("%s: %s"), *tileDataNames[i].ToString(), *data->originLocation.ToString());
FAssetData assetData = AssetRegistryModule.Get().GetAssetByObjectPath(FName(*data->actorPath));
m_ItemsToStream.Add(assetData.ToStringReference());
ItemsToStream.Add(assetData.ToStringReference());
}
assetLoader.RequestAsyncLoad(ItemsToStream, FStreamableDelegate::CreateUObject(this, &AMyLoader::InitTileProperty));
}
void AMyLoader::InitTileProperty() {
for (int i = 0; i < m_ItemsToStream.Num(); ++i) {
UObject* obj = m_ItemsToStream[i].ResolveObject();
UE_LOG(LogTemp, Warning, TEXT("%s"), *obj->GetName());
}
}
Final log shows its proper object name but any actors are not shown in my world and world outliner panel.
Is this correct way to load my assets dynamically? My goal is that loading my blueprint during in game from object path which is specified as following
"/Game/Blueprints/BP_TestActor.BP_TestActor"
that string is read from datatable.
Thanks in advance.