feat: AI 타겟팅 개선 - 사망한 대상 무시
- FindTargetAction: IDamageable.IsDead 체크로 사망한 타겟 제외 - SetTargetInRangeAction: 사망한 타겟을 거리 검색에서 제외 - HasTargetCondition: 타겟 생존 여부 추가 확인 - BossArea: FindObjectOfType → FindFirstObjectByType 변경 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -3,11 +3,12 @@ using UnityEngine;
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using Condition = Unity.Behavior.Condition;
|
||||
using Colosseum.Combat;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 타겟이 존재하는지 확인합니다.
|
||||
/// 타겟이 존재하고 살아있는지 확인합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(name: "Has Target", story: "Has [Target]", category: "Combat")]
|
||||
@@ -18,7 +19,19 @@ namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
return Target.Value != null && Target.Value.activeInHierarchy;
|
||||
if (Target.Value == null || !Target.Value.activeInHierarchy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 타겟이 사망했는지 확인
|
||||
IDamageable damageable = Target.Value.GetComponent<IDamageable>();
|
||||
if (damageable != null && damageable.IsDead)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user