21 lines
694 B
C#
21 lines
694 B
C#
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
||
using Opsive.Shared.Utility;
|
||
using UnityEngine;
|
||
|
||
namespace Cielonos.MainGame.Characters.AI
|
||
{
|
||
[Description("尝试申请攻击令牌。成功返回 Success,令牌已满返回 Failure。")]
|
||
[Category("Cielonos")]
|
||
public class TryAcquireAttackToken : AutomataConditionalBase
|
||
{
|
||
[Tooltip("要申请的令牌类型。")]
|
||
public AttackTokenType tokenType = AttackTokenType.MeleeAttack;
|
||
|
||
public override TaskStatus OnUpdate()
|
||
{
|
||
bool acquired = CombatManager.CoordinatorSm.TryAcquireToken(self, tokenType);
|
||
return acquired ? TaskStatus.Success : TaskStatus.Failure;
|
||
}
|
||
}
|
||
}
|