CapersProject/Assets/Behavior Designer/Runtime/Tasks/Unity/SharedVariables/SetSharedBool.cs

26 lines
751 B
C#
Raw Normal View History

2024-06-03 18:26:03 +00:00
namespace BehaviorDesigner.Runtime.Tasks.Unity.SharedVariables
{
[TaskCategory("Unity/SharedVariable")]
[TaskDescription("Sets the SharedBool variable to the specified object. Returns Success.")]
public class SetSharedBool : Action
{
[Tooltip("The value to set the SharedBool to")]
public SharedBool targetValue;
[RequiredField]
[Tooltip("The SharedBool to set")]
public SharedBool targetVariable;
public override TaskStatus OnUpdate()
{
targetVariable.Value = targetValue.Value;
return TaskStatus.Success;
}
public override void OnReset()
{
targetValue = false;
targetVariable = false;
}
}
}