Invoke() public method

public Invoke ( ) : object
return object
Esempio n. 1
0
        public override IEnumerator <NodeResult> NodeTask()
        {
#if UNITY_EDITOR
            yield return(NodeResult.Continue);
#endif
            yield return(((bool)method.Invoke()) ? NodeResult.Success : NodeResult.Failure);
        }
Esempio n. 2
0
        public override IEnumerator <NodeResult> NodeTask()
        {
            var child = children[0].GetNodeTask();

            while (true)
            {
                if (!(bool)method.Invoke())
                {
                    children[0].Abort();
                    yield return(NodeResult.Failure);

                    yield break;
                }
                else
                {
                    if (child.MoveNext())
                    {
                        yield return(child.Current);
                    }
                    else
                    {
                        //This will happen if the child tasks ends without a fail or success.
                        yield return(NodeResult.Failure);

                        yield break;
                    }
                }
            }
        }
Esempio n. 3
0
        public override IEnumerator <NodeResult> NodeTask()
        {
            if (ChildIsMissing())
            {
                yield return(NodeResult.Failure);
            }
            var result = (bool)method.Invoke();

            if (result)
            {
                var task = children [0].GetNodeTask();
                while (task.MoveNext())
                {
                    yield return(task.Current);
                }
            }
            else
            {
                yield return(NodeResult.Failure);
            }
        }