No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WaitUnit.cs 838B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. namespace Unity.VisualScripting
  3. {
  4. [UnitCategory("Time")]
  5. public abstract class WaitUnit : Unit
  6. {
  7. /// <summary>
  8. /// The moment at which to start the delay.
  9. /// </summary>
  10. [DoNotSerialize]
  11. [PortLabelHidden]
  12. public ControlInput enter { get; private set; }
  13. /// <summary>
  14. /// The action to execute after the delay has elapsed.
  15. /// </summary>
  16. [DoNotSerialize]
  17. [PortLabelHidden]
  18. public ControlOutput exit { get; private set; }
  19. protected override void Definition()
  20. {
  21. enter = ControlInputCoroutine(nameof(enter), Await);
  22. exit = ControlOutput(nameof(exit));
  23. Succession(enter, exit);
  24. }
  25. protected abstract IEnumerator Await(Flow flow);
  26. }
  27. }