void Start() { var untilAction = UntilAction.Allocate(() => Input.GetMouseButtonDown(0)); untilAction.OnEndedCallback = () => { Debug.Log("鼠标按钮点击了"); }; this.ExecuteNode(untilAction); }
//[UnityTest] public IEnumerator UntilActionTest() { var watch = new Stopwatch(); var untilAction = UntilAction.Allocate(() => Time.time > 3); watch.Start(); while (!untilAction.Execute(Time.deltaTime)) { yield return(new WaitForEndOfFrame()); } watch.Stop(); Debug.Log(watch.ElapsedMilliseconds); }