DestroyAllAsteroids() 공개 메소드

public DestroyAllAsteroids ( ) : void
리턴 void
예제 #1
0
    // Вызывается объектами, завершающими игру при разрушении
    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; // обнулить счетчик
    }
예제 #2
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();
    }
예제 #3
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;
        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();
    }
예제 #4
0
 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();
 }
예제 #5
0
    public void GameOver()
    {
        ShowUI(gameOverMenu);
        gameIsPlaying = false;

        if (currentShip != null)
        {
            Destroy(currentShip);
        }

        if (currentSpaceStation != null)
        {
            Destroy(currentSpaceStation);
        }

        asteroidSpawner.spawnAsteroids = false;
        asteroidSpawner.DestroyAllAsteroids();
    }
예제 #6
0
 // Вызывается объектами, завершающими игру при разрушении
 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();
 }