Exemple #1
0
 private void CheckHighScore()
 {
     if (gameSession.CalculateFinalScore() > PlayerPrefsController.GetHighScore())
     {
         PlayerPrefsController.SetHighScore(gameSession.CalculateFinalScore());
     }
 }
Exemple #2
0
    private void Start()
    {
        gameSession = FindObjectOfType <GameSessionScore>().GetComponent <GameSessionScore>();

        CheckHighScore();

        arrowsAvoidedText.text  = "Arrows Avoided: " + gameSession.projectilesAvoided.ToString();
        pointsPickedUpText.text = "Points Picked up: " + gameSession.pointsPickedup.ToString();
        multiplierText.text     = "Multiplier: " + gameSession.multiplier.ToString();
        finalScoreText.text     = "Final Score: " + gameSession.CalculateFinalScore().ToString();
        highScoreText.text      = "High Score: " + PlayerPrefsController.GetHighScore().ToString();
    }
Exemple #3
0
 public void BirdDied()
 {
     gameOverText.SetActive(true);
     highScoreObj.SetActive(true);
     if (score > PlayerPrefsController.GetHighScore() && PlayerPrefsController.GetEasyToggle() == 0)
     {
         PlayerPrefsController.SetHighScore(score);
         highScoreText.text = "High Score : " + score.ToString();
     }
     else
     {
         highScoreText.text = "High Score : " + PlayerPrefsController.GetHighScore().ToString();
     }
     StartCoroutine(DeathDelay(0.2f));
 }
Exemple #4
0
 private void Start()
 {
     //if the player has set a high score display it in the main menu
     if (PlayerPrefsController.GetHighScore() > 0)
     {
         highScoreText.text        = "High Score: " + PlayerPrefsController.GetHighScore().ToString();
         highScoreTextOutline.text = "High Score: " + PlayerPrefsController.GetHighScore().ToString();
     }
     //if no high score found, disable the text in the main menu
     else
     {
         highScoreText.gameObject.GetComponent <TextMeshProUGUI>().enabled        = false;
         highScoreTextOutline.gameObject.GetComponent <TextMeshProUGUI>().enabled = false;
     }
 }
    private void UpdateHighScoreText()
    {
        Text highScoreText = GameObject.FindWithTag(HIGH_SCORE_TEXT).GetComponent <Text>();

        highScoreText.text = "Highest Wave Completed: " + playerPrefsController.GetHighScore().ToString();
    }
Exemple #6
0
    private void UpdateHighScoreText()

    {
        highScore          = PlayerPrefsController.GetHighScore();
        highScoreText.text = "Farthest Flown: " + highScore.ToString() + "m";
    }