RepeatNodeExample.cs 527 B

1234567891011121314151617181920212223242526
  1. using UnityEngine;
  2. namespace QFramework.Example.ActionKit
  3. {
  4. public class RepeatNodeExample : MonoBehaviour
  5. {
  6. void Start()
  7. {
  8. var delay = DelayAction.Allocate(1.0f, () => Debug.Log("延时 1 秒"));
  9. var repeatNode = new RepeatNode(delay,10);
  10. this.ExecuteNode(repeatNode);
  11. }
  12. void Simplefy()
  13. {
  14. // 不填次数就是无限循环
  15. this.Repeat()
  16. .Delay(1.0f)
  17. .Event(() => Debug.Log("延时 1 秒"))
  18. .Begin();
  19. }
  20. }
  21. }