Example #1
0
    public void SetGameState()
    {
        if (timerManager.timer < 0 && gameState == GameState.START)
        {
            timerManager.ChangeText(timerTextGame);
            timerManager.ResetTimer(120);
            gameState = GameState.PLAY;
            _audioSource.PlayOneShot(cloche);
        }
        else if (timerManager.timer < 0 && gameState == GameState.PLAY)
        {
            gameState = GameState.END;
            spawningManager.stopSpawning();

            _audioSource.clip = scoreRecapSound;
            _audioSource.Play();
            _audioSource.loop = true;
        }

        finalScore.gameObject.SetActive(gameState == GameState.END);
        backgroundBlack.gameObject.SetActive(gameState == GameState.END);
    }