暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Collections;
  2. namespace Unity.VisualScripting
  3. {
  4. public abstract class LoopUnit : Unit
  5. {
  6. /// <summary>
  7. /// The entry point for the loop.
  8. /// </summary>
  9. [DoNotSerialize]
  10. [PortLabelHidden]
  11. public ControlInput enter { get; private set; }
  12. /// <summary>
  13. /// The action to execute after the loop has been completed or broken.
  14. /// </summary>
  15. [DoNotSerialize]
  16. public ControlOutput exit { get; private set; }
  17. /// <summary>
  18. /// The action to execute at each loop.
  19. /// </summary>
  20. [DoNotSerialize]
  21. public ControlOutput body { get; private set; }
  22. protected override void Definition()
  23. {
  24. enter = ControlInputCoroutine(nameof(enter), Loop, LoopCoroutine);
  25. exit = ControlOutput(nameof(exit));
  26. body = ControlOutput(nameof(body));
  27. Succession(enter, body);
  28. Succession(enter, exit);
  29. }
  30. protected abstract ControlOutput Loop(Flow flow);
  31. protected abstract IEnumerator LoopCoroutine(Flow flow);
  32. }
  33. }