本文整理汇总了C++中ULocalPlayer::GetWorld方法的典型用法代码示例。如果您正苦于以下问题:C++ ULocalPlayer::GetWorld方法的具体用法?C++ ULocalPlayer::GetWorld怎么用?C++ ULocalPlayer::GetWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ULocalPlayer
的用法示例。
在下文中一共展示了ULocalPlayer::GetWorld方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Tick
//.........这里部分代码省略.........
if (!IsRunningDedicatedServer() && !IsRunningCommandlet())
{
QUICK_SCOPE_CYCLE_COUNTER(STAT_UGameEngine_Tick_CheckCaptures);
// Only update reflection captures in game once all 'always loaded' levels have been loaded
// This won't work with actual level streaming though
if (Context.World()->AreAlwaysLoadedLevelsLoaded())
{
// Update sky light first because it's considered direct lighting, sky diffuse will be visible in reflection capture indirect specular
USkyLightComponent::UpdateSkyCaptureContents(Context.World());
UReflectionCaptureComponent::UpdateReflectionCaptureContents(Context.World());
}
}
if (!bIdleMode)
{
// Tick the world.
GameCycles=0;
CLOCK_CYCLES(GameCycles);
Context.World()->Tick( LEVELTICK_All, DeltaSeconds );
UNCLOCK_CYCLES(GameCycles);
}
// Issue cause event after first tick to provide a chance for the game to spawn the player and such.
if( Context.World()->bWorldWasLoadedThisTick )
{
Context.World()->bWorldWasLoadedThisTick = false;
const TCHAR* InitialExec = Context.LastURL.GetOption(TEXT("causeevent="),NULL);
ULocalPlayer* GamePlayer = Context.OwningGameInstance ? Context.OwningGameInstance->GetFirstGamePlayer() : NULL;
if( InitialExec && GamePlayer )
{
UE_LOG(LogEngine, Log, TEXT("Issuing initial cause event passed from URL: %s"), InitialExec);
GamePlayer->Exec( GamePlayer->GetWorld(), *(FString("CAUSEEVENT ") + InitialExec), *GLog );
}
Context.World()->bTriggerPostLoadMap = true;
}
// Tick the viewports.
if ( GameViewport != NULL && !bIdleMode )
{
SCOPE_CYCLE_COUNTER(STAT_GameViewportTick);
GameViewport->Tick(DeltaSeconds);
}
UpdateTransitionType(Context.World());
// fixme: this will only happen once due to the static bool, but still need to figure out how to handle this for multiple worlds
if (FPlatformProperties::SupportsWindowedMode())
{
// Hide the splashscreen and show the game window
static bool bFirstTime = true;
if ( bFirstTime )
{
bFirstTime = false;
FPlatformSplash::Hide();
if ( GameViewportWindow.IsValid() )
{
GameViewportWindow.Pin()->ShowWindow();
FSlateApplication::Get().RegisterGameViewport( GameViewportWidget.ToSharedRef() );
}
}
}
if (!bIdleMode && !IsRunningDedicatedServer() && !IsRunningCommandlet())
示例2: Tick
//.........这里部分代码省略.........
TickWorldTravel(Context, DeltaSeconds);
if (!IsRunningDedicatedServer() && !IsRunningCommandlet())
{
// Only update reflection captures in game once all 'always loaded' levels have been loaded
// This won't work with actual level streaming though
if (Context.World()->AreAlwaysLoadedLevelsLoaded())
{
// Update sky light first because it's considered direct lighting, sky diffuse will be visible in reflection capture indirect specular
USkyLightComponent::UpdateSkyCaptureContents(Context.World());
UReflectionCaptureComponent::UpdateReflectionCaptureContents(Context.World());
}
}
if (!bIdleMode)
{
// Tick the world.
GameCycles=0;
CLOCK_CYCLES(GameCycles);
Context.World()->Tick( LEVELTICK_All, DeltaSeconds );
UNCLOCK_CYCLES(GameCycles);
}
// Issue cause event after first tick to provide a chance for the game to spawn the player and such.
if( Context.World()->bWorldWasLoadedThisTick )
{
Context.World()->bWorldWasLoadedThisTick = false;
const TCHAR* InitialExec = Context.LastURL.GetOption(TEXT("causeevent="),NULL);
ULocalPlayer* GamePlayer = Context.GamePlayers.Num() > 0 ? Context.GamePlayers[0] : NULL;
if( InitialExec && GamePlayer )
{
UE_LOG(LogEngine, Log, TEXT("Issuing initial cause event passed from URL: %s"), InitialExec);
GamePlayer->Exec( GamePlayer->GetWorld(), *(FString("CAUSEEVENT ") + InitialExec), *GLog );
}
Context.World()->bTriggerPostLoadMap = true;
}
// Tick the viewports.
if ( GameViewport != NULL && !bIdleMode )
{
SCOPE_CYCLE_COUNTER(STAT_GameViewportTick);
GameViewport->Tick(DeltaSeconds);
}
UpdateTransitionType(Context.World());
// fixme: this will only happen once due to the static bool, but still need to figure out how to handle this for multiple worlds
if (FPlatformProperties::SupportsWindowedMode())
{
// Hide the splashscreen and show the game window
static bool bFirstTime = true;
if ( bFirstTime )
{
bFirstTime = false;
FPlatformSplash::Hide();
if ( GameViewportWindow.IsValid() )
{
GameViewportWindow.Pin()->ShowWindow();
FSlateApplication::Get().RegisterGameViewport( GameViewportWidget.ToSharedRef() );
}
}
}
if (!bIdleMode && !IsRunningDedicatedServer() && !IsRunningCommandlet())