Files
BusyRabbit/Source/BusyRabbit/Public/Gas/BusyAttributeSet.h

65 lines
1.8 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "AttributeSet.h"
#include "AbilitySystemComponent.h"
#include "BusyAttributeSet.generated.h"
#define MY_ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FPW_OnAttributeChanged, FString, Name, float, OldValue, float, NewValue);
/**
*
*/
UCLASS()
class BUSYRABBIT_API UPW_AttributeSet: public UAttributeSet{
GENERATED_BODY()
public:
virtual bool RegisterCustomAttribute();
virtual void PostAttributeChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue)override;
public:
UPROPERTY(BlueprintReadWrite)
FPW_OnAttributeChanged OnAttributeChanged;
protected:
};
UCLASS()
class BUSYRABBIT_API UBusyRoleAttributeSet : public UPW_AttributeSet {
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Attributes")
FGameplayAttributeData Health;
MY_ATTRIBUTE_ACCESSORS(UBusyRoleAttributeSet, Health);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Attributes")
FGameplayAttributeData Hunger;
MY_ATTRIBUTE_ACCESSORS(UBusyRoleAttributeSet, Hunger);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Attributes")
FGameplayAttributeData MoveSpeed;
MY_ATTRIBUTE_ACCESSORS(UBusyRoleAttributeSet, MoveSpeed);
};
UCLASS()
class BUSYRABBIT_API UBusyLevelItemAttributeSet : public UPW_AttributeSet {
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Attributes")
FGameplayAttributeData Health;
MY_ATTRIBUTE_ACCESSORS(UBusyRoleAttributeSet, Health);
};