mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 16:34:41 +01:00
25 lines
456 B
C#
25 lines
456 B
C#
using BehaviorDesigner.Runtime.Tasks;
|
|
|
|
namespace MoleMole
|
|
{
|
|
public class HasAttackTarget : Conditional
|
|
{
|
|
private BaseMonoAbilityEntity _entity;
|
|
|
|
public override void OnAwake()
|
|
{
|
|
_entity = GetComponent<BaseMonoAbilityEntity>();
|
|
}
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
BaseMonoEntity attackTarget = _entity.GetAttackTarget();
|
|
if (attackTarget != null)
|
|
{
|
|
return TaskStatus.Success;
|
|
}
|
|
return TaskStatus.Failure;
|
|
}
|
|
}
|
|
}
|