Initial commit
This commit is contained in:
50
Source/Aura/Private/Character/AuraEnemy.cpp
Normal file
50
Source/Aura/Private/Character/AuraEnemy.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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()
|
||||
{
|
||||
GetMesh()->SetRenderCustomDepth(true);
|
||||
GetMesh()->SetCustomDepthStencilValue(250.f);
|
||||
Weapon->SetRenderCustomDepth(true);
|
||||
Weapon->SetCustomDepthStencilValue(250.f);
|
||||
}
|
||||
|
||||
void AAuraEnemy::UnHighlightActor()
|
||||
{
|
||||
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();
|
||||
}
|
||||
Reference in New Issue
Block a user