starting to add the hud in the sample

This commit is contained in:
Arnaud Jamin
2023-10-06 17:22:23 -04:00
parent 92396410d4
commit b18e62cd02
112 changed files with 707 additions and 333 deletions
+19 -1
View File
@@ -2,11 +2,16 @@
#include "CoreMinimal.h"
#include "AbilitySystemInterface.h"
#include "CogSampleDamageEvent.h"
#include "GameFramework/PlayerController.h"
#include "CogSamplePlayerController.generated.h"
class UCogSampleTargetAcquisition;
//--------------------------------------------------------------------------------------------------------------------------
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FCogSampleTargetChangedEventDelegate, ACogSamplePlayerController*, Controller, AActor*, NewTarget, AActor*, OldTarget);
//--------------------------------------------------------------------------------------------------------------------------
UCLASS(config=Game)
class ACogSamplePlayerController : public APlayerController
{
@@ -22,12 +27,25 @@ public:
virtual void Tick(float DeltaSeconds);
void SetTarget(AActor* Value);
AActor* GetTarget() const { return Target.Get(); }
UPROPERTY(BlueprintAssignable)
FCogSampleTargetChangedEventDelegate OnTargetChanged;
UPROPERTY(BlueprintAssignable)
FCogSampleDamageEventDelegate OnPawnDealtDamage;
private:
UFUNCTION(Reliable, Server)
void Server_SetTarget(AActor* Value);
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = TargetAcquisition, meta = (AllowPrivateAccess = "true"))
UCogSampleTargetAcquisition* TargetAcquisition = nullptr;
UPROPERTY(BlueprintReadOnly, Category = TargetAcquisition, meta = (AllowPrivateAccess = "true"))
TSoftObjectPtr<AActor> Target = nullptr;
TWeakObjectPtr<AActor> Target = nullptr;
};