CustomActionExample.cs 713 B

123456789101112131415161718192021222324252627282930313233343536
  1. using UnityEngine;
  2. // ReSharper disable once CheckNamespace
  3. namespace QFramework.Example
  4. {
  5. public class CustomActionExample : MonoBehaviour
  6. {
  7. // Use this for initialization
  8. void Start()
  9. {
  10. this.ExecuteNode(OnlyBeginAction.Allocate(nodeAction =>
  11. {
  12. this.Delay(1.0f, nodeAction.Finish);
  13. // this.transform.DOLocalMove(new Vector3(5, 5), 0.5f).OnComplete(() =>
  14. // {
  15. // nodeAction.Finish();
  16. // });
  17. }));
  18. this.Sequence()
  19. .Delay(1.0f)
  20. .OnlyBegin(action =>
  21. {
  22. this.Delay(1.0f, action.Finish);
  23. // this.transform.DOLocalMove(new Vector3(-5, -5), 0.5f).OnComplete(() =>
  24. // {
  25. // action.Finish();
  26. // });
  27. })
  28. .Begin();
  29. }
  30. }
  31. }