void Awake() { /* As a matter of special preference, any node that has the same name as the host gameobject along with the "_Node" suffix is added to our Waypoint List. * For example, if our name is "MON" and we have 40 Nodes in-game, 10 of which have the tag "MON_Node", these 10 nodes will be added to our Waypoint List. */ waypoints = new List <GameObject>(GameObject.FindGameObjectsWithTag(transform.name + "_Node")); // Setting up all the references initialSpeed = GetComponent <NavMeshAgent>().speed; initialAcceleration = GetComponent <NavMeshAgent>().acceleration; initialAngularSpeed = GetComponent <NavMeshAgent>().angularSpeed; nav = GetComponent <NavMeshAgent>(); mySenses = GetComponent <AI_Senses>(); playerGameObject = GameObject.FindGameObjectWithTag("Player"); }
void Awake() { /* As a matter of special preference, any node that has the same name as the host gameobject along with the "_Node" suffix is added to our Waypoint List. * For example, if our name is "MON" and we have 40 Nodes in-game, 10 of which have the tag "MON_Node", these 10 nodes will be added to our Waypoint List. */ waypoints = new List<GameObject>(GameObject.FindGameObjectsWithTag(transform.name + "_Node")); // Setting up all the references initialSpeed = GetComponent<NavMeshAgent>().speed; initialAcceleration = GetComponent<NavMeshAgent>().acceleration; initialAngularSpeed = GetComponent<NavMeshAgent>().angularSpeed; nav = GetComponent<NavMeshAgent>(); mySenses = GetComponent<AI_Senses>(); playerGameObject = GameObject.FindGameObjectWithTag("Player"); }