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


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

本文整理汇总了C++中ULevelStreaming::IsLevelVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ ULevelStreaming::IsLevelVisible方法的具体用法?C++ ULevelStreaming::IsLevelVisible怎么用?C++ ULevelStreaming::IsLevelVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ULevelStreaming的用法示例。


在下文中一共展示了ULevelStreaming::IsLevelVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
				}
			}

			if ( CVarDemoTimeDilation.GetValueOnGameThread() >= 0.0f )
			{
				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 );
					
					SpectatorController->GetSpectatorPawn()->PrimaryActorTick.bTickEvenWhenPaused = true;

					USpectatorPawnMovement* SpectatorMovement = Cast<USpectatorPawnMovement>(SpectatorController->GetSpectatorPawn()->GetMovementComponent());

					if ( SpectatorMovement )
					{
						SpectatorMovement->bIgnoreTimeDilation = true;
						SpectatorMovement->PrimaryComponentTick.bTickEvenWhenPaused = true;
					}
				}
			}

			if ( bDemoPlaybackDone )
			{
				return;
			}

			if ( World->GetWorldSettings()->Pauser == NULL )
			{
				TickDemoPlayback( DeltaSeconds );
			}
		}
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:68,代码来源:DemoNetDriver.cpp


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