// Use this for initialization void Awake() { currentController = this; transform.tag = "AI Controller"; GameObject[] tempCoverNodeObjects = GameObject.FindGameObjectsWithTag("Cover"); minDistForDynamicCoverSimilarity = minDistForDynamicCoverSimilarity * minDistForDynamicCoverSimilarity; //Compile all cover nodes into a list in order to quickly find them //Prevents us from doing costly FindWithTag and GetComponent //Also doesn't require the use of tags. List <ParagonAI.CoverNodeScript> tempScripsList = new List <ParagonAI.CoverNodeScript>(); for (int i = 0; i < tempCoverNodeObjects.Length; i++) { tempScripsList.Add(tempCoverNodeObjects[i].GetComponent <ParagonAI.CoverNodeScript>()); } coverNodeScripts = tempScripsList.ToArray(); }
// Use this for initialization void Awake() { currentController = this; transform.tag = "AI Controller"; GameObject[] tempCoverNodeObjects = GameObject.FindGameObjectsWithTag("Cover"); // print(tempCoverNodeObjects.Length); minDistForDynamicCoverSimilarity = minDistForDynamicCoverSimilarity * minDistForDynamicCoverSimilarity; //Compile all cover nodes into a list in order to quickly find them //Prevents us from doing costly FindWithTag and GetComponent //Also doesn't require the use of tags. List<ParagonAI.CoverNodeScript> tempScripsList = new List<ParagonAI.CoverNodeScript>(); for (int i = 0; i < tempCoverNodeObjects.Length; i++) { tempScripsList.Add(tempCoverNodeObjects[i].GetComponent<ParagonAI.CoverNodeScript>()); } coverNodeScripts = tempScripsList.ToArray(); }