Exemplo n.º 1
0
    // BEWARE: BOB's blackboard is not the BB engine
    // managed blackboard.


    public override void OnStart()
    {
        blackboard = gameObject.GetComponent <BOB_Blackboard>();
        if (blackboard == null)
        {
            Debug.Log("No blackboard attached to gameobject in Action Buy Beer");
        }
        base.OnStart();
    }
    // only relevant method for conditions. Perform a check and return the result
    public override bool Check()
    {
        // get the blackboard. Fail + error message if no blackboard attached
        BOB_Blackboard blackboard = gameObject.GetComponent <BOB_Blackboard>();

        if (blackboard == null)
        {
            Debug.Log("No blackboard attached to gameobject in condition CheckMoney");
            return(false);
        }

        return(blackboard.HasMoneyToBuyBeer());
    }
Exemplo n.º 3
0
    // only relevant method for conditions. Perform a check and return the result
    public override bool Check()
    {
        // get the blackboard. Fail + error message if no blackboard attached
        BOB_Blackboard blackboard = gameObject.GetComponent <BOB_Blackboard>();

        if (blackboard == null)
        {
            Debug.Log("No blackboard attached to gameobject in condition ThirstTooHigh");
            return(false);
        }

        return(blackboard.VeryThirsty());
    }
    public override TaskStatus OnUpdate()
    {
        // get the blackboard. Fail + error message if no blackboard attached
        BOB_Blackboard blackboard = gameObject.GetComponent <BOB_Blackboard>();

        if (blackboard == null)
        {
            Debug.Log("No blackboard attached to gameobject in Get paid. Failing");
            return(TaskStatus.FAILED);
        }
        else
        {
            blackboard.GetPaid();
            return(TaskStatus.COMPLETED);
        }
    }