本文整理汇总了C++中ULevelStreaming::GetWorldAssetPackageName方法的典型用法代码示例。如果您正苦于以下问题:C++ ULevelStreaming::GetWorldAssetPackageName方法的具体用法?C++ ULevelStreaming::GetWorldAssetPackageName怎么用?C++ ULevelStreaming::GetWorldAssetPackageName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ULevelStreaming
的用法示例。
在下文中一共展示了ULevelStreaming::GetWorldAssetPackageName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReplicateStreamingStatus
void AGameModeBase::ReplicateStreamingStatus(APlayerController* PC)
{
UWorld* MyWorld = GetWorld();
if (MyWorld->GetWorldSettings()->bUseClientSideLevelStreamingVolumes)
{
// Client will itself decide what to stream
return;
}
// Don't do this for local players or players after the first on a splitscreen client
if (Cast<ULocalPlayer>(PC->Player) == nullptr && Cast<UChildConnection>(PC->Player) == nullptr)
{
// If we've loaded levels via CommitMapChange() that aren't normally in the StreamingLevels array, tell the client about that
if (MyWorld->CommittedPersistentLevelName != NAME_None)
{
PC->ClientPrepareMapChange(MyWorld->CommittedPersistentLevelName, true, true);
// Tell the client to commit the level immediately
PC->ClientCommitMapChange();
}
if (MyWorld->StreamingLevels.Num() > 0)
{
// Tell the player controller the current streaming level status
for (int32 LevelIndex = 0; LevelIndex < MyWorld->StreamingLevels.Num(); LevelIndex++)
{
ULevelStreaming* TheLevel = MyWorld->StreamingLevels[LevelIndex];
if (TheLevel != nullptr)
{
const ULevel* LoadedLevel = TheLevel->GetLoadedLevel();
UE_LOG(LogGameMode, Log, TEXT("levelStatus: %s %i %i %i %s %i"),
*TheLevel->GetWorldAssetPackageName(),
TheLevel->bShouldBeVisible,
LoadedLevel && LoadedLevel->bIsVisible,
TheLevel->bShouldBeLoaded,
*GetNameSafe(LoadedLevel),
TheLevel->bHasLoadRequestPending);
PC->ClientUpdateLevelStreamingStatus(
TheLevel->GetWorldAssetPackageFName(),
TheLevel->bShouldBeLoaded,
TheLevel->bShouldBeVisible,
TheLevel->bShouldBlockOnLoad,
TheLevel->LevelLODIndex);
}
}
PC->ClientFlushLevelStreaming();
}
// If we're preparing to load different levels using PrepareMapChange() inform the client about that now
if (MyWorld->PreparingLevelNames.Num() > 0)
{
for (int32 LevelIndex = 0; LevelIndex < MyWorld->PreparingLevelNames.Num(); LevelIndex++)
{
PC->ClientPrepareMapChange(MyWorld->PreparingLevelNames[LevelIndex], LevelIndex == 0, LevelIndex == MyWorld->PreparingLevelNames.Num() - 1);
}
// DO NOT commit these changes yet - we'll send that when we're done preparing them
}
}
}