feat: add enemy threat targeting system

This commit is contained in:
2026-03-19 20:43:57 +09:00
parent 2faf41a0bb
commit 1cb46e1d8d
4 changed files with 355 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ using UnityEngine;
using Action = Unity.Behavior.Action;
using Unity.Properties;
using Colosseum.Combat;
using Colosseum.Enemy;
[Serializable, GeneratePropertyBag]
[NodeDescription(name: "SetTargetInRange", story: "[Range] [Tag] ", category: "Action", id: "93b7a5d823a58618d5371c01ef894948")]
@@ -33,6 +34,17 @@ public partial class SetTargetInRangeAction : Action
return Status.Failure;
}
EnemyBase enemy = GameObject.GetComponent<EnemyBase>();
if (enemy != null && enemy.UseThreatSystem)
{
GameObject threatTarget = enemy.GetHighestThreatTarget(Target?.Value, Tag.Value, Range.Value);
if (threatTarget != null)
{
Target.Value = threatTarget;
return Status.Success;
}
}
// 가장 가까운 살아있는 타겟 찾기
GameObject nearestTarget = null;
float nearestDistance = Range.Value; // Range 내에서만 검색