RealtimeStyleTransferRuntime/Plugins/CommonGame/Source/Public/CommonLocalPlayer.h

54 lines
2.0 KiB
C
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
2022-09-13 07:18:28 +00:00
#include "Delegates/Delegate.h"
2022-05-23 18:41:30 +00:00
#include "Engine/LocalPlayer.h"
2022-09-13 07:18:28 +00:00
#include "HAL/Platform.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "CommonLocalPlayer.generated.h"
2022-09-13 07:18:28 +00:00
class APawn;
class APlayerController;
class APlayerState;
class FViewport;
class UObject;
2022-05-23 18:41:30 +00:00
class UPrimaryGameLayout;
2022-09-13 07:18:28 +00:00
struct FSceneViewProjectionData;
2022-05-23 18:41:30 +00:00
UCLASS(config=Engine, transient)
class COMMONGAME_API UCommonLocalPlayer : public ULocalPlayer
{
GENERATED_BODY()
public:
UCommonLocalPlayer();
/** Called when the local player is assigned a player controller */
DECLARE_MULTICAST_DELEGATE_TwoParams(FPlayerControllerSetDelegate, UCommonLocalPlayer* LocalPlayer, APlayerController* PlayerController);
FPlayerControllerSetDelegate OnPlayerControllerSet;
/** Called when the local player is assigned a player state */
DECLARE_MULTICAST_DELEGATE_TwoParams(FPlayerStateSetDelegate, UCommonLocalPlayer* LocalPlayer, APlayerState* PlayerState);
FPlayerStateSetDelegate OnPlayerStateSet;
/** Called when the local player is assigned a player pawn */
DECLARE_MULTICAST_DELEGATE_TwoParams(FPlayerPawnSetDelegate, UCommonLocalPlayer* LocalPlayer, APawn* Pawn);
FPlayerPawnSetDelegate OnPlayerPawnSet;
FDelegateHandle CallAndRegister_OnPlayerControllerSet(FPlayerControllerSetDelegate::FDelegate Delegate);
FDelegateHandle CallAndRegister_OnPlayerStateSet(FPlayerStateSetDelegate::FDelegate Delegate);
FDelegateHandle CallAndRegister_OnPlayerPawnSet(FPlayerPawnSetDelegate::FDelegate Delegate);
public:
virtual bool GetProjectionData(FViewport* Viewport, FSceneViewProjectionData& ProjectionData, int32 StereoViewIndex) const override;
bool IsPlayerViewEnabled() const { return bIsPlayerViewEnabled; }
void SetIsPlayerViewEnabled(bool bInIsPlayerViewEnabled) { bIsPlayerViewEnabled = bInIsPlayerViewEnabled; }
UPrimaryGameLayout* GetRootUILayout() const;
private:
bool bIsPlayerViewEnabled = true;
};