UntilActionExample.cs 513 B

1234567891011121314151617181920212223242526272829
  1. using UnityEngine;
  2. namespace QFramework.Example.ActionKit
  3. {
  4. public class UntilActionExample : MonoBehaviour
  5. {
  6. void Start()
  7. {
  8. var untilAction = UntilAction.Allocate(() => Input.GetMouseButtonDown(0));
  9. untilAction.OnEndedCallback = () =>
  10. {
  11. Debug.Log("鼠标按钮点击了");
  12. };
  13. this.ExecuteNode(untilAction);
  14. }
  15. void Simplify()
  16. {
  17. this.Sequence()
  18. .Until(() => Input.GetMouseButtonDown(0))
  19. .Event(() => Debug.Log("鼠标按钮点击了"))
  20. .Begin();
  21. }
  22. }
  23. }