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: "FindTarget", story: "[타겟] 탐색", category: "Action", id: "bb947540549026f3c5625c6d19213311")]
|
||||
@@ -30,6 +31,17 @@ public partial class FindTargetAction : Action
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
EnemyBase enemy = GameObject.GetComponent<EnemyBase>();
|
||||
if (enemy != null && enemy.UseThreatSystem)
|
||||
{
|
||||
GameObject threatTarget = enemy.GetHighestThreatTarget(Target?.Value, Tag.Value);
|
||||
if (threatTarget != null)
|
||||
{
|
||||
Target.Value = threatTarget;
|
||||
return Status.Success;
|
||||
}
|
||||
}
|
||||
|
||||
// 사망하지 않은 타겟 찾기
|
||||
foreach (GameObject candidate in candidates)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user