22 lines
765 B
C#
22 lines
765 B
C#
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
|
using Opsive.GraphDesigner.Runtime.Variables;
|
|
using Opsive.Shared.Utility;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Characters.AI
|
|
{
|
|
[Category("SLS Utilities")]
|
|
[Description("检查一个计时器是否满足条件。")]
|
|
public class CheckCooldownTimer : AutomataConditionalBase
|
|
{
|
|
public SharedVariable<string> timerName;
|
|
public bool checkIfCompleted = true;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
Timer timer = self.selfTimeSm.coolDownTimers[timerName.Value];
|
|
bool conditionMet = checkIfCompleted ? timer.IsCompleted : !timer.IsCompleted;
|
|
return conditionMet ? TaskStatus.Success : TaskStatus.Failure;
|
|
}
|
|
}
|
|
} |