|
|
|
|
| #include "LyraCharacterWithAbilities.h"
|
|
|
| #include "AbilitySystem/Attributes/LyraCombatSet.h"
|
| #include "AbilitySystem/Attributes/LyraHealthSet.h"
|
| #include "AbilitySystem/LyraAbilitySystemComponent.h"
|
| #include "Async/TaskGraphInterfaces.h"
|
|
|
| #include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCharacterWithAbilities)
|
|
|
| ALyraCharacterWithAbilities::ALyraCharacterWithAbilities(const FObjectInitializer& ObjectInitializer)
|
| : Super(ObjectInitializer)
|
| {
|
| AbilitySystemComponent = ObjectInitializer.CreateDefaultSubobject<ULyraAbilitySystemComponent>(this, TEXT("AbilitySystemComponent"));
|
| AbilitySystemComponent->SetIsReplicated(true);
|
| AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed);
|
|
|
|
|
| HealthSet = CreateDefaultSubobject<ULyraHealthSet>(TEXT("HealthSet"));
|
| CombatSet = CreateDefaultSubobject<ULyraCombatSet>(TEXT("CombatSet"));
|
|
|
|
|
| SetNetUpdateFrequency(100.0f);
|
| }
|
|
|
| void ALyraCharacterWithAbilities::PostInitializeComponents()
|
| {
|
| Super::PostInitializeComponents();
|
|
|
| check(AbilitySystemComponent);
|
| AbilitySystemComponent->InitAbilityActorInfo(this, this);
|
| }
|
|
|
| UAbilitySystemComponent* ALyraCharacterWithAbilities::GetAbilitySystemComponent() const
|
| {
|
| return AbilitySystemComponent;
|
| }
|
|
|
|
|