22 lines
768 B
C#
22 lines
768 B
C#
|
|
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
|||
|
|
using Opsive.GraphDesigner.Runtime.Variables;
|
|||
|
|
using Opsive.Shared.Utility;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
namespace Cielonos.MainGame.Characters.AI
|
|||
|
|
{
|
|||
|
|
[Description("尝试申请扇区。成功返回 Success,所有扇区已满返回 Failure。")]
|
|||
|
|
[Category("Cielonos")]
|
|||
|
|
public class TryAcquireSector : AutomataConditionalBase
|
|||
|
|
{
|
|||
|
|
[Tooltip("敌人的交战距离(站位半径)。")]
|
|||
|
|
[SerializeField] protected SharedVariable<float> m_EngageRadius = 3f;
|
|||
|
|
|
|||
|
|
public override TaskStatus OnUpdate()
|
|||
|
|
{
|
|||
|
|
bool acquired = CombatManager.CoordinatorSm.TryAcquireSector(self, m_EngageRadius.Value);
|
|||
|
|
return acquired ? TaskStatus.Success : TaskStatus.Failure;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|