当前位置: 首页>>代码示例>>C++>>正文


C++ ULevelStreaming::IsLevelLoaded方法代码示例

本文整理汇总了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;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:43,代码来源:WorldComposition.cpp

示例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 );
		}
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:55,代码来源:DemoNetDriver.cpp


注:本文中的ULevelStreaming::IsLevelLoaded方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。