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
@@ -0,0 +1,40 @@
#pragma once
#include "CoreMinimal.h"
#include "AbilitySystemComponent.h"
#include "Kismet/BlueprintAsyncActionBase.h"
#include "CogSampleTask_WaitAttributeChanged.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnAttributeChangedDelegate, FGameplayAttribute, Attribute, float, NewValue, float, OldValue)
;
/**
* Blueprint node to automatically register a listener for all attribute changes in an AbilitySystemComponent.
*/
UCLASS(BlueprintType, meta = (ExposedAsyncProxy = AsyncTask))
class UCogSampleTask_WaitAttributeChanged : public UBlueprintAsyncActionBase
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintAssignable)
FOnAttributeChangedDelegate OnAttributeChanged;
UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true"))
static UCogSampleTask_WaitAttributeChanged* ListenForAttributeChange(UAbilitySystemComponent* AbilitySystemComponent, FGameplayAttribute Attribute);
virtual void Activate() override;
UFUNCTION(BlueprintCallable)
void EndTask();
protected:
UPROPERTY()
UAbilitySystemComponent* AbilitySystemComponent = nullptr;
FGameplayAttribute AttributeToListenFor;
void AttributeChanged(const FOnAttributeChangeData& Data);
};