Ejemplo n.º 1
0
 IEnumerator RunBehaviour()
 {
     BTNode.Result res = Root.Execute();
     while (true) // res == BTNode.Result.Running
     {
         res = Root.Execute();
         yield return(null);
     }
 }
Ejemplo n.º 2
0
    IEnumerator RunBehavior()
    {
        BTNode.Result result = Root.Execute();
        while (result == BTNode.Result.Running)
        {
            yield return(null);

            result = Root.Execute();
        }
    }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
        /// <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;
        }
Ejemplo n.º 6
0
 /// <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();
 }