搬了lyra的hudlayout

This commit is contained in:
2023-08-28 03:38:23 +08:00
parent b9666b7fe7
commit c90b2d2956
343 changed files with 10665 additions and 2 deletions

View File

@@ -0,0 +1,72 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "CommonPlayerController.h"
#include "CommonLocalPlayer.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(CommonPlayerController)
class APawn;
ACommonPlayerController::ACommonPlayerController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void ACommonPlayerController::ReceivedPlayer()
{
Super::ReceivedPlayer();
if (UCommonLocalPlayer* LocalPlayer = Cast<UCommonLocalPlayer>(Player))
{
LocalPlayer->OnPlayerControllerSet.Broadcast(LocalPlayer, this);
if (PlayerState)
{
LocalPlayer->OnPlayerStateSet.Broadcast(LocalPlayer, PlayerState);
}
}
}
void ACommonPlayerController::SetPawn(APawn* InPawn)
{
Super::SetPawn(InPawn);
if (UCommonLocalPlayer* LocalPlayer = Cast<UCommonLocalPlayer>(Player))
{
LocalPlayer->OnPlayerPawnSet.Broadcast(LocalPlayer, InPawn);
}
}
void ACommonPlayerController::OnPossess(APawn* APawn)
{
Super::OnPossess(APawn);
if (UCommonLocalPlayer* LocalPlayer = Cast<UCommonLocalPlayer>(Player))
{
LocalPlayer->OnPlayerPawnSet.Broadcast(LocalPlayer, APawn);
}
}
void ACommonPlayerController::OnUnPossess()
{
Super::OnUnPossess();
if (UCommonLocalPlayer* LocalPlayer = Cast<UCommonLocalPlayer>(Player))
{
LocalPlayer->OnPlayerPawnSet.Broadcast(LocalPlayer, nullptr);
}
}
void ACommonPlayerController::OnRep_PlayerState()
{
Super::OnRep_PlayerState();
if (PlayerState)
{
if (UCommonLocalPlayer* LocalPlayer = Cast<UCommonLocalPlayer>(Player))
{
LocalPlayer->OnPlayerStateSet.Broadcast(LocalPlayer, PlayerState);
}
}
}