20. Constructing the ASC and AS
This commit is contained in:
@ -1,7 +1,14 @@
|
||||
#include "GasaPlayerState.h"
|
||||
|
||||
#include "AbilitySystem/GasaAbilitySystemComponent.h"
|
||||
|
||||
AGasaPlayerState::AGasaPlayerState()
|
||||
{
|
||||
AbilitySystem = CreateDefaultSubobject<UGasaAbilitySystemComp>("Ability System");
|
||||
AbilitySystem->SetIsReplicated(true);
|
||||
|
||||
Attributes = CreateDefaultSubobject<UAttributeSet>("Attributes");
|
||||
|
||||
// Replication
|
||||
NetUpdateFrequency = 100.f;
|
||||
}
|
||||
|
@ -1,13 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "AbilitySystemInterface.h"
|
||||
#include "GameFramework/PlayerState.h"
|
||||
|
||||
#include "GasaCommon.h"
|
||||
|
||||
#include "GasaPlayerState.generated.h"
|
||||
|
||||
UCLASS(Blueprintable)
|
||||
class GASA_API AGasaPlayerState : public APlayerState
|
||||
, public IAbilitySystemInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
#pragma region Ability System
|
||||
UPROPERTY(EditAnywhere, Category="Ability System")
|
||||
bool bAutoAbilitySystem = true;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="Ability System")
|
||||
TObjectPtr<UAbilitySystemComponent> AbilitySystem;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="Ability System")
|
||||
TObjectPtr<UAttributeSet> Attributes;
|
||||
#pragma endregion Ability System
|
||||
|
||||
AGasaPlayerState();
|
||||
|
||||
#pragma region IAbilitySystem
|
||||
FORCEINLINE UAttributeSet* GetAttributes() { return Attributes; }
|
||||
FORCEINLINE UAbilitySystemComponent* GetAbilitySystemComponent() const override { return AbilitySystem; }
|
||||
#pragma endregion IAbilitySystem
|
||||
};
|
||||
|
Reference in New Issue
Block a user