예제 #1
0
        void Start()
        {
            var untilAction = UntilAction.Allocate(() => Input.GetMouseButtonDown(0));

            untilAction.OnEndedCallback = () =>
            {
                Debug.Log("鼠标按钮点击了");
            };

            this.ExecuteNode(untilAction);
        }
예제 #2
0
    //[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);
    }