void InstantiatePrefab() { Vector3 prefabPosition = new Vector3(0, 0, 0); GameObject newGameObject; if (RandomLocation == true) { prefabPosition = GenerateRandomPosition(); } newGameObject = Instantiate(PrefabToSpawn, prefabPosition, Quaternion.identity); CollisionTestSphere colTestInstance = newGameObject.GetComponent <CollisionTestSphere>(); if (colTestInstance != null) { colTestInstance.mySpawner = this; colTestSpheres.Add(colTestInstance); } }
public void RemoveMe(CollisionTestSphere colTestInstance) { colTestSpheres.Remove(colTestInstance); }