IEnumerator RunBehaviour() { BTNode.Result res = Root.Execute(); while (true) // res == BTNode.Result.Running { res = Root.Execute(); yield return(null); } }
IEnumerator RunBehavior() { BTNode.Result result = Root.Execute(); while (result == BTNode.Result.Running) { yield return(null); result = Root.Execute(); } }
IEnumerator CoRunBehaviour() { BTNode.Result result = Root.Execute(); while (result == BTNode.Result.Running) { Debug.Log("Root result: " + result); yield return(null); result = Root.Execute(); } Debug.Log("Behaviour has finished with " + result); }
private IEnumerator RunBehavior() { BTNode.Result result = Root.Execute(); while (result == BTNode.Result.Running) { //Debug.Log("Root result: " + result); yield return(null); result = Root.Execute(); } //Debug.Log("Behavior has finished with: " + result); }
/// <summary> Coroutine function to run the behaviour tree in. </summary> /// <returns> Coroutine </returns> IEnumerator RunBehaviour() { BTNode.Result result = root.Execute(); while (result == BTNode.Result.Running) { yield return(null); result = root.Execute(); } running = false; }
/// <summary> /// Called when the behavior tree finishes completely, use this to add a BT the state machine will drop into by default /// </summary> public virtual void FinishTree(BTNode.Result result) { Debug.Log("Behavior has finished with : " + result + " This does not have a drop out state. Exiting State"); ExitTree(); }