Exemple #1
0
        /// <summary>
        /// If the game over signal is broadcast, stop the thruster particles and sound
        /// </summary>
        /// <param name="signal"></param>
        /// <returns></returns>
        private bool OnGameOverSignal(GameOverSignal signal)
        {
            _thrustEmission.enabled = false;
            thrustSound.Stop();

            return(true);
        }
Exemple #2
0
        /// <summary>
        /// If the game over signal is broadcase, we play a winning sound if appropriate.
        /// </summary>
        /// <param name="signal"></param>
        /// <returns></returns>
        private bool OnGameOverSignal(GameOverSignal signal)
        {
            if (signal.state == GameOverState.Won)
            {
                winSound.Play();
            }

            return(true);
        }
Exemple #3
0
        /// <summary>
        /// If a game over signal is broadcast, set up the game over UI
        /// </summary>
        /// <param name="signal"></param>
        /// <returns></returns>
        private bool OnGameOverSignal(GameOverSignal signal)
        {
            gameOverText.gameObject.SetActive(true);
            gameOverText.text = signal.state == GameOverState.Start ? "" : "Game Over\nYou " + (signal.state == GameOverState.Won ? "Win!" : "Lose...");

            replayText.gameObject.SetActive(true);
            instructionsText.gameObject.SetActive(false);

            return(true);
        }
Exemple #4
0
        /// <summary>
        /// If the game over signal is broadcast, set the input state of the game
        /// </summary>
        /// <param name="signal"></param>
        /// <returns></returns>
        private bool OnGameOver(GameOverSignal signal)
        {
            _gameState = GameState.GameOver;

            return(true);
        }