IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckBooleanTrigger.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

28 lines
687 B
C#

using NodeCanvas.Framework;
using ParadoxNotion.Design;
namespace NodeCanvas.Tasks.Conditions
{
[Category("✫ Blackboard")]
[Description("Check if a boolean variable is true and if so, it is immediately reset to false.")]
public class CheckBooleanTrigger : ConditionTask
{
[BlackboardOnly]
public BBParameter<bool> trigger;
protected override string info {
get { return string.Format("Trigger {0}", trigger); }
}
protected override bool OnCheck() {
if ( trigger.value ) {
trigger.value = false;
return true;
}
return false;
}
}
}