本文整理汇总了C++中ULevelStreaming::IsLevelLoaded方法的典型用法代码示例。如果您正苦于以下问题:C++ ULevelStreaming::IsLevelLoaded方法的具体用法?C++ ULevelStreaming::IsLevelLoaded怎么用?C++ ULevelStreaming::IsLevelLoaded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ULevelStreaming
的用法示例。
在下文中一共展示了ULevelStreaming::IsLevelLoaded方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateEditorStreamingState
bool UWorldComposition::UpdateEditorStreamingState(const FVector& InLocation)
{
UWorld* OwningWorld = GetWorld();
bool bStateChanged = false;
// Handle only editor worlds
if (!OwningWorld->IsGameWorld() &&
!OwningWorld->IsVisibilityRequestPending())
{
// Get the list of visible and hidden levels from current view point
TArray<FDistanceVisibleLevel> DistanceVisibleLevels;
TArray<FDistanceVisibleLevel> DistanceHiddenLevels;
GetDistanceVisibleLevels(InLocation, DistanceVisibleLevels, DistanceHiddenLevels);
// Hidden levels
for (const auto& Level : DistanceHiddenLevels)
{
ULevelStreaming* EditorStreamingLevel = OwningWorld->GetLevelStreamingForPackageName(TilesStreaming[Level.TileIdx]->GetWorldAssetPackageFName());
if (EditorStreamingLevel &&
EditorStreamingLevel->IsLevelLoaded() &&
EditorStreamingLevel->bShouldBeVisibleInEditor != false)
{
EditorStreamingLevel->bShouldBeVisibleInEditor = false;
bStateChanged = true;
}
}
// Visible levels
for (const auto& Level : DistanceVisibleLevels)
{
ULevelStreaming* EditorStreamingLevel = OwningWorld->GetLevelStreamingForPackageName(TilesStreaming[Level.TileIdx]->GetWorldAssetPackageFName());
if (EditorStreamingLevel &&
EditorStreamingLevel->IsLevelLoaded() &&
EditorStreamingLevel->bShouldBeVisibleInEditor != true)
{
EditorStreamingLevel->bShouldBeVisibleInEditor = true;
bStateChanged = true;
}
}
}
return bStateChanged;
}
示例2: TickFlush
void UDemoNetDriver::TickFlush( float DeltaSeconds )
{
Super::TickFlush( DeltaSeconds );
if ( FileAr )
{
if ( ClientConnections.Num() > 0 )
{
TickDemoRecord( DeltaSeconds );
}
else if ( ServerConnection != NULL )
{
// Wait until all levels are streamed in
for ( int32 i = 0; i < World->StreamingLevels.Num(); ++i )
{
ULevelStreaming * StreamingLevel = World->StreamingLevels[i];
if ( StreamingLevel != NULL && ( !StreamingLevel->IsLevelLoaded() || !StreamingLevel->GetLoadedLevel()->GetOutermost()->IsFullyLoaded() || !StreamingLevel->IsLevelVisible() ) )
{
// Abort, we have more streaming levels to load
return;
}
}
World->GetWorldSettings()->DemoPlayTimeDilation = CVarDemoTimeDilation.GetValueOnGameThread();
// Clamp time between 1000 hz, and 2 hz
// (this is useful when debugging and you set a breakpoint, you don't want all that time to pass in one frame)
DeltaSeconds = FMath::Clamp( DeltaSeconds, 1.0f / 1000.0f, 1.0f / 2.0f );
// We need to compensate for the fact that DeltaSeconds is real-time for net drivers
DeltaSeconds *= World->GetWorldSettings()->GetEffectiveTimeDilation();
// Update time dilation on spectator pawn to compensate for any demo dilation
// (we want to continue to fly around in real-time)
if ( SpectatorController != NULL )
{
if ( SpectatorController->GetSpectatorPawn() != NULL )
{
// Disable collision on the spectator
SpectatorController->GetSpectatorPawn()->SetActorEnableCollision( false );
// Apply time dilation on spectator to reverse the effects of global dilation
SpectatorController->GetSpectatorPawn()->CustomTimeDilation = 1.0f / World->GetWorldSettings()->DemoPlayTimeDilation;
}
}
if ( bDemoPlaybackDone )
{
return;
}
TickDemoPlayback( DeltaSeconds );
}
}
}