本文整理汇总了C++中UGameViewportClient::SetupInitialLocalPlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ UGameViewportClient::SetupInitialLocalPlayer方法的具体用法?C++ UGameViewportClient::SetupInitialLocalPlayer怎么用?C++ UGameViewportClient::SetupInitialLocalPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UGameViewportClient
的用法示例。
在下文中一共展示了UGameViewportClient::SetupInitialLocalPlayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void UGameEngine::Init(IEngineLoop* InEngineLoop)
{
DECLARE_SCOPE_CYCLE_COUNTER(TEXT("UGameEngine Init"), STAT_GameEngineStartup, STATGROUP_LoadTime);
// Call base.
UEngine::Init(InEngineLoop);
#if USE_NETWORK_PROFILER
FString NetworkProfilerTag;
if( FParse::Value(FCommandLine::Get(), TEXT("NETWORKPROFILER="), NetworkProfilerTag ) )
{
GNetworkProfiler.EnableTracking(true);
}
#endif
// Load all of the engine modules that we need at startup that are not editor-related
UGameEngine::LoadRuntimeEngineStartupModules();
// Load and apply user game settings
GetGameUserSettings()->LoadSettings();
GetGameUserSettings()->ApplyNonResolutionSettings();
// Create game instance. For GameEngine, this should be the only GameInstance that ever gets created.
{
FStringClassReference GameInstanceClassName = GetDefault<UGameMapsSettings>()->GameInstanceClass;
UClass* GameInstanceClass = (GameInstanceClassName.IsValid() ? LoadObject<UClass>(NULL, *GameInstanceClassName.ToString()) : UGameInstance::StaticClass());
GameInstance = NewObject<UGameInstance>(this, GameInstanceClass);
GameInstance->InitializeStandalone();
}
// // Creates the initial world context. For GameEngine, this should be the only WorldContext that ever gets created.
// FWorldContext& InitialWorldContext = CreateNewWorldContext(EWorldType::Game);
// Initialize the viewport client.
UGameViewportClient* ViewportClient = NULL;
if(GIsClient)
{
ViewportClient = NewObject<UGameViewportClient>(this, GameViewportClientClass);
ViewportClient->Init(*GameInstance->GetWorldContext(), GameInstance);
GameViewport = ViewportClient;
GameInstance->GetWorldContext()->GameViewport = ViewportClient;
}
bCheckForMovieCapture = true;
// Attach the viewport client to a new viewport.
if(ViewportClient)
{
// This must be created before any gameplay code adds widgets
bool bWindowAlreadyExists = GameViewportWindow.IsValid();
if (!bWindowAlreadyExists)
{
GameViewportWindow = CreateGameWindow();
}
CreateGameViewport( ViewportClient );
if( !bWindowAlreadyExists )
{
SwitchGameWindowToUseGameViewport();
}
FString Error;
if(ViewportClient->SetupInitialLocalPlayer(Error) == NULL)
{
UE_LOG(LogEngine, Fatal,TEXT("%s"),*Error);
}
UGameViewportClient::OnViewportCreated().Broadcast();
}
GameInstance->StartGameInstance();
UE_LOG(LogInit, Display, TEXT("Game Engine Initialized.") );
// for IsInitialized()
bIsInitialized = true;
}