SetSharedQuaternion.cs 834 B

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