SetSharedBool.cs 751 B

1234567891011121314151617181920212223242526
  1. namespace BehaviorDesigner.Runtime.Tasks.Unity.SharedVariables
  2. {
  3. [TaskCategory("Unity/SharedVariable")]
  4. [TaskDescription("Sets the SharedBool variable to the specified object. Returns Success.")]
  5. public class SetSharedBool : Action
  6. {
  7. [Tooltip("The value to set the SharedBool to")]
  8. public SharedBool targetValue;
  9. [RequiredField]
  10. [Tooltip("The SharedBool to set")]
  11. public SharedBool targetVariable;
  12. public override TaskStatus OnUpdate()
  13. {
  14. targetVariable.Value = targetValue.Value;
  15. return TaskStatus.Success;
  16. }
  17. public override void OnReset()
  18. {
  19. targetValue = false;
  20. targetVariable = false;
  21. }
  22. }
  23. }