mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-17 09:52:23 -07:00
starting to add the hud in the sample
This commit is contained in:
@@ -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);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user