38 lines
1.3 KiB
C++
38 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "LyraCharacterWithAbilities.h"
|
|
|
|
#include "AbilitySystem/Attributes/LyraCombatSet.h"
|
|
#include "AbilitySystem/Attributes/LyraHealthSet.h"
|
|
#include "AbilitySystem/LyraAbilitySystemComponent.h"
|
|
#include "AbilitySystemComponent.h"
|
|
#include "HAL/Platform.h"
|
|
#include "Misc/AssertionMacros.h"
|
|
|
|
ALyraCharacterWithAbilities::ALyraCharacterWithAbilities(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
AbilitySystemComponent = ObjectInitializer.CreateDefaultSubobject<ULyraAbilitySystemComponent>(this, TEXT("AbilitySystemComponent"));
|
|
AbilitySystemComponent->SetIsReplicated(true);
|
|
AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed);
|
|
|
|
CreateDefaultSubobject<ULyraHealthSet>(TEXT("HealthSet"));
|
|
CreateDefaultSubobject<ULyraCombatSet>(TEXT("CombatSet"));
|
|
|
|
// AbilitySystemComponent needs to be updated at a high frequency.
|
|
NetUpdateFrequency = 100.0f;
|
|
}
|
|
|
|
void ALyraCharacterWithAbilities::PostInitializeComponents()
|
|
{
|
|
Super::PostInitializeComponents();
|
|
|
|
check(AbilitySystemComponent);
|
|
AbilitySystemComponent->InitAbilityActorInfo(this, this);
|
|
}
|
|
|
|
UAbilitySystemComponent* ALyraCharacterWithAbilities::GetAbilitySystemComponent() const
|
|
{
|
|
return AbilitySystemComponent;
|
|
}
|