// Вызывается объектами, завершающими игру при разрушении public void GameOver() { GameObject.Find("Audio Manager").GetComponent <AudioManager>().StopMusic(); GameObject.Find("Audio Manager").GetComponent <AudioManager>().PlayIntroMusic(); UpdateScore(); // update highscore // Показать меню завершения игры ShowUI(gameOverUI); // Выйти из режима игры gameIsPlaying = false; // Удалить корабль и станцию if (currentShip != null) { Destroy(currentShip); } if (currentSpaceStation != null) { Destroy(currentSpaceStation); } // Скрыть предупреждающую рамку, если она видима warningUI.SetActive(false); // Прекратить создавать астероиды AsteroidSpawner.spawnAsteroids = false; // и удалить все уже созданные астероиды AsteroidSpawner.DestroyAllAsteroids(); asteroidCount = 0; // обнулить счетчик }
// END 3d_gamemanager_startgame // BEGIN 3d_gamemanager_gameover // Called by objects that end the game when they're destroyed public void GameOver() { // Show the game over UI ShowUI(gameOverUI); // We're no longer playing gameIsPlaying = false; // Destroy the ship and the station if (currentShip != null) { Destroy(currentShip); } if (currentSpaceStation != null) { Destroy(currentSpaceStation); } // BEGIN 3d_gamemanager_boundary // Stop showing the warning UI, if it was visible warningUI.SetActive(false); // END 3d_gamemanager_boundary // Stop spawning asteroids asteroidSpawner.spawnAsteroids = false; // And remove all lingering asteroids from the game asteroidSpawner.DestroyAllAsteroids(); }
// END 3d_gamemanager_startgame // BEGIN 3d_gamemanager_gameover // Called by objects that end the game when they're destroyed public void GameOver() { // Show the game over UI ShowUI(gameOverUI); // We're no longer playing gameIsPlaying = false; var tt = GameObject.Find("TextTime").GetComponent <Text>(); tt.text = "Your time: " + (timer.startTime - timer.timeRemaining); var sc = GameObject.Find("Score").GetComponent <Text>(); sc.text = "Your score: " + (Mathf.Round((timer.startTime - timer.timeRemaining) * 10)); // Destroy the ship and the station if (currentShip != null) { Destroy(currentShip); } if (currentSpaceStation != null) { Destroy(currentSpaceStation); } // BEGIN 3d_gamemanager_boundary // Stop showing the warning UI, if it was visible warningUI.SetActive(false); // END 3d_gamemanager_boundary // Stop spawning asteroids asteroidSpawner.spawnAsteroids = false; enemySpawner.spawnEnemy = false; // And remove all lingering asteroids from the game asteroidSpawner.DestroyAllAsteroids(); enemySpawner.DestroyAllEnemies(); }
public void GameOver() { ShowUI(gameOverUI); gameIsPlaying = false; if (currentShip != null) { Destroy(currentShip); } if (currentSpaceStation != null) { Destroy(currentSpaceStation); } warningUI.SetActive(false); asteroidSpawner.spawnAsteroids = false; asteroidSpawner.DestroyAllAsteroids(); }
public void GameOver() { ShowUI(gameOverMenu); gameIsPlaying = false; if (currentShip != null) { Destroy(currentShip); } if (currentSpaceStation != null) { Destroy(currentSpaceStation); } asteroidSpawner.spawnAsteroids = false; asteroidSpawner.DestroyAllAsteroids(); }
// Вызывается объектами, завершающими игру при разрушении public void GameOver() { // Показать меню завершения игры ShowUI(gameOverUI); // Выйти из режима игры gameIsPlaying = false; // Удалить корабль и станцию if (currentShip != null) { Destroy(currentShip); } if (currentSpaceStation != null) { Destroy(currentSpaceStation); } // Скрыть предупреждающую рамку, если она видима warningUI.SetActive(false); // Прекратить создавать астероиды asteroidSpawner.spawnAsteroids = false; // и удалить все уже созданные астероиды asteroidSpawner.DestroyAllAsteroids(); }