private void CheckHighScore() { if (gameSession.CalculateFinalScore() > PlayerPrefsController.GetHighScore()) { PlayerPrefsController.SetHighScore(gameSession.CalculateFinalScore()); } }
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(); }
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)); }
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(); }
private void UpdateHighScoreText() { highScore = PlayerPrefsController.GetHighScore(); highScoreText.text = "Farthest Flown: " + highScore.ToString() + "m"; }