SetSharedString.cs 757 B

1234567891011121314151617181920212223242526
  1. namespace BehaviorDesigner.Runtime.Tasks.Unity.SharedVariables
  2. {
  3. [TaskCategory("Unity/SharedVariable")]
  4. [TaskDescription("Sets the SharedString variable to the specified object. Returns Success.")]
  5. public class SetSharedString : Action
  6. {
  7. [Tooltip("The value to set the SharedString to")]
  8. public SharedString targetValue;
  9. [RequiredField]
  10. [Tooltip("The SharedString to set")]
  11. public SharedString 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 = "";
  20. targetVariable = "";
  21. }
  22. }
  23. }