53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
// Copyright Echo Devgroup
|
|
|
|
|
|
#include "Character/AuraEnemy.h"
|
|
|
|
#include "AbilitySystem/AuraAbilitySystemComponent.h"
|
|
#include "AbilitySystem/AuraAttributeSet.h"
|
|
#include "Aura/Aura.h"
|
|
|
|
AAuraEnemy::AAuraEnemy()
|
|
{
|
|
GetMesh()->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
|
|
|
|
AbilitySystemComponent = CreateDefaultSubobject<UAuraAbilitySystemComponent>("AbilitySystemComponent");
|
|
AbilitySystemComponent->SetIsReplicated(true);
|
|
AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Minimal);
|
|
|
|
AttributeSet = CreateDefaultSubobject<UAuraAttributeSet>("AttributeSet");
|
|
}
|
|
|
|
void AAuraEnemy::HighlightActor()
|
|
{
|
|
bHighlighted = true;
|
|
GetMesh()->SetRenderCustomDepth(true);
|
|
GetMesh()->SetCustomDepthStencilValue(250.f);
|
|
Weapon->SetRenderCustomDepth(true);
|
|
Weapon->SetCustomDepthStencilValue(250.f);
|
|
}
|
|
|
|
void AAuraEnemy::UnHighlightActor()
|
|
{
|
|
bHighlighted = false;
|
|
GetMesh()->SetRenderCustomDepth(false);
|
|
Weapon->SetRenderCustomDepth(false);
|
|
}
|
|
|
|
int32 AAuraEnemy::GetPlayerLevel()
|
|
{
|
|
return Level;
|
|
}
|
|
|
|
void AAuraEnemy::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
InitAbilityActorInfo();
|
|
}
|
|
|
|
void AAuraEnemy::InitAbilityActorInfo()
|
|
{
|
|
AbilitySystemComponent->InitAbilityActorInfo(this,this);
|
|
Cast<UAuraAbilitySystemComponent>(AbilitySystemComponent)->AbilityActorInfoSet();
|
|
}
|