Source, config, and docs only — UE template assets stay local to save storage. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
508 B
C++
25 lines
508 B
C++
// Copyright VocationLife Project. All Rights Reserved.
|
|
|
|
#include "VocationEnemy.h"
|
|
#include "CombatComponent.h"
|
|
|
|
AVocationEnemy::AVocationEnemy()
|
|
{
|
|
CombatComponent = CreateDefaultSubobject<UCombatComponent>(TEXT("CombatComponent"));
|
|
AutoPossessAI = EAutoPossessAI::PlacedInWorldOrSpawned;
|
|
}
|
|
|
|
void AVocationEnemy::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
if (CombatComponent)
|
|
{
|
|
CombatComponent->OnDeath.AddDynamic(this, &AVocationEnemy::HandleDeath);
|
|
}
|
|
}
|
|
|
|
void AVocationEnemy::HandleDeath()
|
|
{
|
|
Destroy();
|
|
}
|