feat: 드로그 공통 보스 BT 프레임워크 정리
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Combat;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Action = Unity.Behavior.Action;
|
||||
|
||||
/// <summary>
|
||||
/// 현재 타겟이 살아 있는 유효 대상인지 확인하는 공통 체크 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Validate Target",
|
||||
story: "[Target]이 살아 있는 유효 대상인지 확인",
|
||||
category: "Action",
|
||||
id: "e9ec7a3b5a5447138ecf85ab0c57b21f")]
|
||||
public partial class ValidateTargetAction : Action
|
||||
{
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<GameObject> Target;
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
if (Target?.Value == null || !Target.Value.activeInHierarchy)
|
||||
return Status.Failure;
|
||||
|
||||
IDamageable damageable = Target.Value.GetComponent<IDamageable>();
|
||||
return damageable != null && damageable.IsDead ? Status.Failure : Status.Success;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user