[UE4]一些实用方法

UE singleton 单例实现方法总结

https://blog.csdn.net/cartzhang/article/details/82764433

LNK2019 FAssetEditorManager

https://blog.csdn.net/luofeixiongsix/article/details/79966989

UE4 自定义Asset

https://blog.csdn.net/shidya/article/details/71553360

FModuleManager::LoadModulePtr

https://docs.unrealengine.com/en-us/Programming/Assets/Registry

动态加载流关卡

UWorld* PersistentWorld = GetWorld();

if (!PersistentWorld)

{

    UE_LOG(LogTemp, Fatal, TEXT("UDynamicLevels::LoadTileToStreamingArray >> Invalid PersistentWorld!!!"));

    return;

}

//new StreamingClass Instance 新流关卡实例

UClass* StreamingClass = ULevelStreamingKismet::StaticClass();

ULevelStreaming* StreamingLevel = Cast<ULevelStreaming>(StaticConstructObject(StreamingClass, PersistentWorld, NAME_None, RF_Transient, NULL));

// FName PackageName = TEXT("/Game/TempUmap/Level_01") 根据项目实际情况获取并设置PackageName

StreamingLevel->SetWorldAssetByPackageName(PackageName);

//Make New Level Visible 使流关卡可见

StreamingLevel->bShouldBeLoaded = true;

StreamingLevel->bShouldBeVisible = true;

StreamingLevel->bShouldBlockOnLoad = false;

//Very Important, used by LevelStreaming* to load the map 设置流关卡的包名

StreamingLevel->PackageNameToLoad = PackageName;

//Add to UWorld 将流关卡添加到World中

PersistentWorld->StreamingLevels.Add(StreamingLevel);
 

猜你喜欢

转载自blog.csdn.net/qq173681019/article/details/85961959