24. Health and Mana
Decided to try using gencpp for the first time with UE (just codegen, not parsing). I used it to generate the AttributeSet
This commit is contained in:
@ -1,2 +1,39 @@
|
||||
#include "GasaAttributeSet.h"
|
||||
// This was generated by GasaGen/GasaGen.cpp
|
||||
#include "GasaAttributeSet.h"
|
||||
|
||||
#include "AbilitySystemComponent.h"
|
||||
#include "Net/UnrealNetwork.h"
|
||||
#include "Networking/GasaNetLibrary.h"
|
||||
|
||||
UGasaAttributeSet::UGasaAttributeSet()
|
||||
{
|
||||
}
|
||||
|
||||
void UGasaAttributeSet::Client_OnRep_Health( FGameplayAttributeData& PrevHealth )
|
||||
{
|
||||
GAMEPLAYATTRIBUTE_REPNOTIFY( UGasaAttributeSet, Health, PrevHealth )
|
||||
}
|
||||
|
||||
void UGasaAttributeSet::Client_OnRep_MaxHealth( FGameplayAttributeData& PrevMaxHealth )
|
||||
{
|
||||
GAMEPLAYATTRIBUTE_REPNOTIFY( UGasaAttributeSet, MaxHealth, PrevMaxHealth )
|
||||
}
|
||||
|
||||
void UGasaAttributeSet::Client_OnRep_Mana( FGameplayAttributeData& PrevMana )
|
||||
{
|
||||
GAMEPLAYATTRIBUTE_REPNOTIFY( UGasaAttributeSet, Mana, PrevMana )
|
||||
}
|
||||
|
||||
void UGasaAttributeSet::Client_OnRep_MaxMana( FGameplayAttributeData& PrevMaxMana )
|
||||
{
|
||||
GAMEPLAYATTRIBUTE_REPNOTIFY( UGasaAttributeSet, MaxMana, PrevMaxMana )
|
||||
}
|
||||
|
||||
void UGasaAttributeSet::GetLifetimeReplicatedProps( TArray< FLifetimeProperty >& OutLifetimeProps ) const
|
||||
{
|
||||
Super::GetLifetimeReplicatedProps( OutLifetimeProps );
|
||||
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Health );
|
||||
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, MaxHealth );
|
||||
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Mana );
|
||||
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, MaxMana );
|
||||
}
|
||||
|
@ -1,15 +1,38 @@
|
||||
#pragma once
|
||||
#include "AttributeSet.h"
|
||||
// This was generated by GasaGen/GasaGen.cpp
|
||||
|
||||
#include "AttributeSet.h"
|
||||
|
||||
#include "GasaAttributeSet.generated.h"
|
||||
|
||||
|
||||
UCLASS()
|
||||
class GASA_API UGasaAttributeSet : public UAttributeSet
|
||||
UCLASS() class GASA_API UGasaAttributeSet : public UAttributeSet
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
|
||||
};
|
||||
UPROPERTY( ReplicatedUsing = Client_OnRep_Health, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
|
||||
FGameplayAttributeData Health;
|
||||
|
||||
UPROPERTY( ReplicatedUsing = Client_OnRep_Health, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
|
||||
FGameplayAttributeData MaxHealth;
|
||||
|
||||
UPROPERTY( ReplicatedUsing = Client_OnRep_Health, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
|
||||
FGameplayAttributeData Mana;
|
||||
|
||||
UPROPERTY( ReplicatedUsing = Client_OnRep_Health, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
|
||||
FGameplayAttributeData MaxMana;
|
||||
|
||||
UGasaAttributeSet();
|
||||
|
||||
UFUNCTION()
|
||||
void Client_OnRep_Health( FGameplayAttributeData& PrevHealth );
|
||||
UFUNCTION()
|
||||
void Client_OnRep_MaxHealth( FGameplayAttributeData& PrevMaxHealth );
|
||||
UFUNCTION()
|
||||
void Client_OnRep_Mana( FGameplayAttributeData& PrevMana );
|
||||
UFUNCTION()
|
||||
void Client_OnRep_MaxMana( FGameplayAttributeData& PrevMaxMana );
|
||||
|
||||
#pragma region UObject
|
||||
|
||||
void GetLifetimeReplicatedProps( TArray< FLifetimeProperty >& OutLifetimeProps ) const override;
|
||||
#pragma endregion UObject
|
||||
};
|
||||
|
Reference in New Issue
Block a user