Example #1
0
    public IEnumerator LoseLife()
    {
        _lives--;
        if (_lives == 0)
        {
            GUIFireButton.SetActive(false);
            PlayEffects(1);
            GUIGameOverPanel.SetActive(true);
            gameOverScoreText.text = playerScore.ToString();
            _lives = 0;
        }
        else
        {
            GUIFireButton.SetActive(true);
            PlayEffects(2);
            GUIDog.SetActive(true);
            yield return(new WaitForSeconds(3.0f));

            GUIDog.SetActive(false);
            GUIFireButton.SetActive(true);
            shotsPerRound = 3;
        }
        yield return(new WaitForSeconds(0.2f));

        livesCountText.text = _lives.ToString();
    }
Example #2
0
 public void Restart()
 {
     HideItems();
     _lives = 2;
     livesCountText.text    = _lives.ToString();
     playerScore            = 0;
     scoreCountText.text    = playerScore.ToString();
     _roundTargetScore      = 3;
     roundScore             = 0;
     gameOverScoreText.text = "0";
     round = 1;
     roundTextNumber.text = round.ToString();
     GUIGameOverPanel.SetActive(false);
     StartCoroutine(PlayRound());
 }