Exemple #1
0
    /**
     *  Some actions need to use data from the world state to determine if they are able to run. These preconditions are called procedural preconditions.
     *  Need to check there is food available
     * **/
    public override bool checkProceduralPrecondition(GameObject agent)
    {
        // find the nearest chopping block that we can chop our wood at
        FreePie[] blocks = (FreePie[])UnityEngine.GameObject.FindObjectsOfType(typeof(FreePie));
        if (blocks.Length == 0)
        {
            return(false);
        }

        targetChoppingBlock = blocks[0];
        target = targetChoppingBlock.gameObject;


        return(blocks[0] != null);
    }
Exemple #2
0
 public override void reset()
 {
     bought = false;
     targetChoppingBlock = null;
     startTime           = 0;
 }