//Remove everything from screen (READY SCREEN) public void clearScreen() { helpScreen.SetActive(false); CancelInvoke(); //To not spawn UFO player.GetComponent <PlayerCollision>().cancelRespawn(); //Not respawn player accidentally player.SetActive(false); BigUFO.SetActive(false); SmallUFO.SetActive(false); BigAsteroids.inactiveAll(); MedAsteroids.inactiveAll(); SmallAsteroids.inactiveAll(); }
//Where the asteroids and UFO plays in Main Menu public void startDemo() { player.SetActive(false); BigUFO.SetActive(false); SmallUFO.SetActive(false); spawnAsteroids(); //Spawn 4 asteroids MedAsteroids.inactiveAll(); SmallAsteroids.inactiveAll(); Invoke("spawnUFO", 15f); //Spawn UFO each 15 seconds }
//Gameplay screen public void startGameplay() { player.SetActive(true); player.transform.position = new Vector3(0f, 0f); //Set player to the center of the screen BigUFO.SetActive(false); SmallUFO.SetActive(false); spawnAsteroids(); //Spawn 4 asteroids at begining MedAsteroids.inactiveAll(); SmallAsteroids.inactiveAll(); Invoke("spawnUFO", 15f); }