Пример #1
0
 // Set the content of the ui
 private void setUiContent()
 {
     scoreText.text     = player.getScore().ToString();
     scoreGoalText.text = scoreGoalManager.scoreGoal.ToString();
     timeText.text      = clock.currentTime.ToString();
     winStreakText.text = WinStreakManager.getWinStreak().ToString();
 }
Пример #2
0
    // Set the score goal
    public void setScoreGoal()
    {
        for (int i = 0; i < WinStreakManager.getWinStreak(); i++)
        {
            minScoreGoal += Random.Range(4, 5);
            maxScoreGoal += Random.Range(4, 5);
        }

        print("Min Score Goal: " + minScoreGoal);
        print("Max Score Goal: " + maxScoreGoal);

        scoreGoal = Random.Range(minScoreGoal, maxScoreGoal);
    }
Пример #3
0
    // End the game
    public void endGame(bool playerMadeMistake)
    {
        player.isInputEnabled = false;
        clock.stopClock();


        if (playerMadeMistake == false)
        {
            // If the player has a equal or higher score than the goal
            if (player.getScore() >= scoreGoalManager.scoreGoal)
            {
                // Set the title of the game over ui to be "Goal Achieved"
                gameOverUiRef.title.text = "Goal Achieved";
                WinStreakManager.increaseWinStreak();
            }

            // Otherwise set the title of the game over ui to be "Goal Failed"
            else
            {
                gameOverUiRef.title.text = "Goal Failed";
                gameOverUiRef.restartButton.gameObject.SetActive(false);
            }
        }

        else
        {
            gameOverUiRef.title.text = "Goal Failed";
            gameOverUiRef.restartButton.gameObject.SetActive(false);
        }

        gameOverUiRef.playerScoreText.text = player.getScore().ToString();
        gameOverUiRef.scoreGoalText.text   = scoreGoalManager.scoreGoal.ToString();

        // Set visibility of ui elements
        gameplayUiRef.hideUi();
        gameOverUiRef.showUi();
    }
Пример #4
0
 public override void showUi()
 {
     base.showUi();
     winStreakText.text = WinStreakManager.getWinStreak().ToString();
 }