Files
BusyRabbit/Source/BusyRabbit/Public/Level/Actor/BusyPlayerRole.h

61 lines
1.6 KiB
C++

#pragma once
#include "BusyPawnBase.h"
#include "Level/LevelPlayerController.h"
#include "BusyPlayerRole.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)
UCLASS(Blueprintable, BlueprintType)
class UBusyPlayerRoleAttributeSet: public UBusyPawnAttributeSet
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="饱食度")
FGameplayAttributeData Hunger;
MY_ATTRIBUTE_ACCESSORS(UBusyPlayerRoleAttributeSet, Hunger);
UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="最大饱食度")
FGameplayAttributeData MaxHunger;
MY_ATTRIBUTE_ACCESSORS(UBusyPlayerRoleAttributeSet, MaxHunger);
UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="饱食度消耗速度")
FGameplayAttributeData HungerConsume;
MY_ATTRIBUTE_ACCESSORS(UBusyPlayerRoleAttributeSet, HungerConsume);
};
#undef MY_ATTRIBUTE_ACCESSORS
UCLASS()
class ABusyPlayerRole : public ABusyPawnBase, public IBusyControllable
{
GENERATED_BODY()
public:
ABusyPlayerRole();
virtual void BeginPlay() override;
virtual void InitPawnAttributes(const struct FBusyPawnBaseConfig& Config)override;
protected:
/*--------------------相机相关--------------------------*/
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
TObjectPtr<class USpringArmComponent> SpringArmComponent;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
TObjectPtr<class UCameraComponent> CameraComponent;
};