feat: add enemy threat targeting system
This commit is contained in:
@@ -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 내에서만 검색
|
||||
|
||||
Reference in New Issue
Block a user