// Use this for initialization void Awake() { //Make ref to this getSupply = this; //Make a new list, and add all the Gameobjects as Inactive pooledLazers = new List <GameObject> (); for (int i = 0; i < lazerMax; i++) { GameObject lazer = (GameObject)Instantiate(pooledLazer); lazer.SetActive(false); pooledLazers.Add(lazer); } }
// Use this for initialization void Awake() { getSupply = this; /*Make a new list, and add all the Gameobjects as Inactive*/ pooledLazers = new List <GameObject> (); for (int i = 0; i < lazerMax; i++) { GameObject lazer = (GameObject)Instantiate(pooledLazer); // make Lazer a child ofLazerSupply //lazer.transform.parent = this.transform; lazer.SetActive(false); pooledLazers.Add(lazer); } }