SetInt.cs 626 B

123456789101112131415161718192021222324
  1. namespace BehaviorDesigner.Runtime.Tasks.Unity.Math
  2. {
  3. [TaskCategory("Unity/Math")]
  4. [TaskDescription("Sets an int value")]
  5. public class SetInt : Action
  6. {
  7. [Tooltip("The int value to set")]
  8. public SharedInt intValue;
  9. [Tooltip("The variable to store the result")]
  10. public SharedInt storeResult;
  11. public override TaskStatus OnUpdate()
  12. {
  13. storeResult.Value = intValue.Value;
  14. return TaskStatus.Success;
  15. }
  16. public override void OnReset()
  17. {
  18. intValue.Value = 0;
  19. storeResult.Value = 0;
  20. }
  21. }
  22. }