CapersProject/Assets/Behavior Designer/Runtime/Tasks/Unity/Math/BoolFlip.cs

21 lines
540 B
C#
Raw Normal View History

2024-06-03 18:26:03 +00:00
namespace BehaviorDesigner.Runtime.Tasks.Unity.Math
{
[TaskCategory("Unity/Math")]
[TaskDescription("Flips the value of the bool.")]
public class BoolFlip : Action
{
[Tooltip("The bool to flip the value of")]
public SharedBool boolVariable;
public override TaskStatus OnUpdate()
{
boolVariable.Value = !boolVariable.Value;
return TaskStatus.Success;
}
public override void OnReset()
{
boolVariable.Value = false;
}
}
}