public override IEnumerator<NodeResult> NodeTask()
{
while (true) {
if ((bool)method.Invoke ())
break;
else
yield return NodeResult.Continue;
}
var child = children[0].GetNodeTask ();
while (true) {
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;
}
}
}