BAD.If.NodeTask C# (CSharp) Method

NodeTask() public method

public NodeTask ( ) : IEnumerator
return IEnumerator
        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;
            }
        }