pixachux eae24f1c34 Initial VocationLife commit: C++ gameplay module and project foundation.
Source, config, and docs only — UE template assets stay local to save storage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 23:52:53 +02:00

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();
}