示例#1
0
    // Update is called once per frame
    void Update()
    {
        if (stage == 5 && playerScore > -1 && enemyScore > -1)
        {
            Debug.Log("Stage 6");
            Debug.Log("GM - Player score: " + playerScore + " Enemy score: " + enemyScore);

            if (scoreCounter.CheckPlayerRoundWin(playerScore, enemyScore))
            {
                gameScoreCounter.IncreasePlayerRoundsWon();
            }
            else
            {
                gameScoreCounter.IncreaseEnemyRoundsWon();
            }

            if (!gameScoreCounter.CheckEndOfGame())
            {
                SetStageAndChangeUIMessages(6);
            }
            else
            {
                SetStageAndChangeUIMessages(7);
                uiManager.ChangePlayAgainButtonActionAndText(RestartGame, "Next game");
            }

            uiManager.SetRoundScore(playerScore, enemyScore);
            gameScoreCounter.IncreaseRoundNumber();
        }
    }