/**
     * Coroutine to begin the BehaviorTree
     * @param node The root node
     * @return IEnumerator (see Unity Coroutine)
     */
    private IEnumerator Coroutine_Execute(BehaviorNode node)
    {
        //set this to true as the behavior tree is running
        mStatus = BehaviorReturn.Running;

        mCurrent = node;

        yield return BeginNode(mCurrent);

        //the status of this tree will be whatever the value of the first node was
        mStatus = mCurrent.mReturnValue;

        Debug.Log("BEHAVIOR COMPLETE " + mStatus);
        mCurrent = null;
    }
Example #2
0
 public Leaf(BehaviorReturn actionInput)
 {
     action = actionInput;
 }