//spawns a random asteroid void Spawn() { // generate random index int randomIndex = Random.Range(0, asteroidPieces.Length); //select random asteroid piece GameObject asteroid = asteroidPieces[randomIndex]; //ask the asteroid manager to spawn a new asteroid piece at a posistion //asking the Singleton AsteroidManagerB.Spawn(asteroid, this.transform.position); }
private void Awake() { Instance = this; }