本文整理汇总了C++中ULevelStreaming::GetWorldAssetPackageFName方法的典型用法代码示例。如果您正苦于以下问题:C++ ULevelStreaming::GetWorldAssetPackageFName方法的具体用法?C++ ULevelStreaming::GetWorldAssetPackageFName怎么用?C++ ULevelStreaming::GetWorldAssetPackageFName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ULevelStreaming
的用法示例。
在下文中一共展示了ULevelStreaming::GetWorldAssetPackageFName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetLevelStreamingForPackageName
/** Utility for returning the ULevelStreaming object for a particular sub-level, specified by package name */
ULevelStreaming* UWorld::GetLevelStreamingForPackageName(FName InPackageName)
{
// iterate over each level streaming object
for( int32 LevelIndex=0; LevelIndex<StreamingLevels.Num(); LevelIndex++ )
{
ULevelStreaming* LevelStreaming = StreamingLevels[LevelIndex];
// see if name matches
if(LevelStreaming && LevelStreaming->GetWorldAssetPackageFName() == InPackageName)
{
// it doesn't, return this one
return LevelStreaming;
}
}
// failed to find one
return NULL;
}
示例2: FindStreamingLevel
/**
* Returns the streaming level by package name, or NULL if none exists.
*
* @param PackageName Name of the package containing the ULevel to query
* @return The level's streaming level, or NULL if none exists.
*/
ULevelStreaming* FLevelUtils::FindStreamingLevel(UWorld* InWorld, const TCHAR* InPackageName)
{
const FName PackageName( InPackageName );
ULevelStreaming* MatchingLevel = NULL;
if( InWorld)
{
for( int32 LevelIndex = 0 ; LevelIndex< InWorld->StreamingLevels.Num() ; ++LevelIndex )
{
ULevelStreaming* CurStreamingLevel = InWorld->StreamingLevels[ LevelIndex ];
if( CurStreamingLevel && CurStreamingLevel->GetWorldAssetPackageFName() == PackageName )
{
MatchingLevel = CurStreamingLevel;
break;
}
}
}
return MatchingLevel;
}
示例3: 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
}
}
}