Ejemplo n.º 1
0
    public override bool checkProceduralPrecondition(GameObject agent)
    {
        if (goapActionControllerInstance == null)
        {
            goapActionControllerInstance = FindObjectOfType <GOAPActionController>();
        }
        if (!goapActionControllerInstance.patrolRandomlyActionEnabled)
        {
            return(false);
        }

        waypoint = SpawnRandomWaypoint();

        if (thisGoapMonsterAgent == null)
        {
            thisGoapMonsterAgent = GetComponent <GOAPMonsterAgent>();
        }
        if (thisGoapMonsterAgent != null && waypoint != null)
        {
            thisGoapMonsterAgent.instantiatedWaypoints.Add(waypoint);
        }

        target = waypoint;
        return(waypoint != null);
    }
Ejemplo n.º 2
0
    public void Reset()
    {
        this.gameObject.SetActive(true);
        hasBomb = false;
        isAlive = true;

        //GOAP
        GOAPMonsterAgent goapAgent = GetComponent <GOAPMonsterAgent>();

        if (goapAgent != null)
        {
            goapAgent.CancelPlan();
        }
    }