SetString.cs 650 B

1234567891011121314151617181920212223242526
  1. namespace BehaviorDesigner.Runtime.Tasks.Unity.UnityString
  2. {
  3. [TaskCategory("Unity/String")]
  4. [TaskDescription("Sets the variable string to the value string.")]
  5. public class SetString : Action
  6. {
  7. [Tooltip("The target string")]
  8. [RequiredField]
  9. public SharedString variable;
  10. [Tooltip("The value string")]
  11. public SharedString value;
  12. public override TaskStatus OnUpdate()
  13. {
  14. variable.Value = value.Value;
  15. return TaskStatus.Success;
  16. }
  17. public override void OnReset()
  18. {
  19. variable = "";
  20. value = "";
  21. }
  22. }
  23. }