Download LyraStarterGame/Plugins/CommonGame/Source/Private/CommonLocalPlayer.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.04 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Plugins/CommonGame/Source/Private/CommonLocalPlayer.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Plugins/CommonGame/Source/Private/CommonLocalPlayer.cpp
-
curl -L -o CommonLocalPlayer.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Plugins/CommonGame/Source/Private/CommonLocalPlayer.cpp
2.04 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class APawn; | |
| class APlayerState; | |
| class FViewport; | |
| struct FSceneViewProjectionData; | |
| UCommonLocalPlayer::UCommonLocalPlayer() | |
| : Super(FObjectInitializer::Get()) | |
| { | |
| } | |
| FDelegateHandle UCommonLocalPlayer::CallAndRegister_OnPlayerControllerSet(FPlayerControllerSetDelegate::FDelegate Delegate) | |
| { | |
| APlayerController* PC = GetPlayerController(GetWorld()); | |
| if (PC) | |
| { | |
| Delegate.Execute(this, PC); | |
| } | |
| return OnPlayerControllerSet.Add(Delegate); | |
| } | |
| FDelegateHandle UCommonLocalPlayer::CallAndRegister_OnPlayerStateSet(FPlayerStateSetDelegate::FDelegate Delegate) | |
| { | |
| APlayerController* PC = GetPlayerController(GetWorld()); | |
| APlayerState* PlayerState = PC ? PC->PlayerState : nullptr; | |
| if (PlayerState) | |
| { | |
| Delegate.Execute(this, PlayerState); | |
| } | |
| return OnPlayerStateSet.Add(Delegate); | |
| } | |
| FDelegateHandle UCommonLocalPlayer::CallAndRegister_OnPlayerPawnSet(FPlayerPawnSetDelegate::FDelegate Delegate) | |
| { | |
| APlayerController* PC = GetPlayerController(GetWorld()); | |
| APawn* Pawn = PC ? PC->GetPawn() : nullptr; | |
| if (Pawn) | |
| { | |
| Delegate.Execute(this, Pawn); | |
| } | |
| return OnPlayerPawnSet.Add(Delegate); | |
| } | |
| bool UCommonLocalPlayer::GetProjectionData(FViewport* Viewport, FSceneViewProjectionData& ProjectionData, int32 StereoViewIndex) const | |
| { | |
| if (!bIsPlayerViewEnabled) | |
| { | |
| return false; | |
| } | |
| return Super::GetProjectionData(Viewport, ProjectionData, StereoViewIndex); | |
| } | |
| UPrimaryGameLayout* UCommonLocalPlayer::GetRootUILayout() const | |
| { | |
| if (UGameUIManagerSubsystem* UIManager = GetGameInstance()->GetSubsystem<UGameUIManagerSubsystem>()) | |
| { | |
| if (UGameUIPolicy* Policy = UIManager->GetCurrentUIPolicy()) | |
| { | |
| return Policy->GetRootLayout(this); | |
| } | |
| } | |
| return nullptr; | |
| } | |