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); }
public void Reset() { this.gameObject.SetActive(true); hasBomb = false; isAlive = true; //GOAP GOAPMonsterAgent goapAgent = GetComponent <GOAPMonsterAgent>(); if (goapAgent != null) { goapAgent.CancelPlan(); } }