Added Gameplay Abilities(Health, MaxHealth, Mana, MaxMana)
This commit is contained in:
@@ -3,18 +3,33 @@
|
||||
|
||||
#include "Crunch/Public/Character/CCharacter.h"
|
||||
|
||||
#include "GAS/CAbilitySystemComponent.h"
|
||||
#include "GAS/CAttributeSet.h"
|
||||
|
||||
|
||||
// Sets default values
|
||||
ACCharacter::ACCharacter()
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
GetMesh()->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
|
||||
CAbilitySystemComponent = CreateDefaultSubobject<UCAbilitySystemComponent>(TEXT("Ability System Component"));
|
||||
CAttributeSet = CreateDefaultSubobject<UCAttributeSet>(TEXT("CAttribute Set"));
|
||||
}
|
||||
|
||||
void ACCharacter::ServerSideInit()
|
||||
{
|
||||
CAbilitySystemComponent->InitAbilityActorInfo(this, this);
|
||||
CAbilitySystemComponent->ApplyInitialEffects();
|
||||
}
|
||||
|
||||
void ACCharacter::ClientSideInit()
|
||||
{
|
||||
CAbilitySystemComponent->InitAbilityActorInfo(this, this);
|
||||
}
|
||||
|
||||
void ACCharacter::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
void ACCharacter::Tick(float DeltaTime)
|
||||
@@ -27,3 +42,8 @@ void ACCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponen
|
||||
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
||||
}
|
||||
|
||||
UAbilitySystemComponent* ACCharacter::GetAbilitySystemComponent() const
|
||||
{
|
||||
return CAbilitySystemComponent;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user