private void UpdateScore() { int _newScore = (int)(_player.transform.position.x - _playerStartPos.x); if (_newScore > _saver.GetScore()) { _saver.SetScore(_newScore); UpdateScoreText(); } }
void OnDestroy() { if (a.GetScore() > highscore) { ; } highscore = a.GetScore(); PlayerPrefs.SetInt("highscore", highscore); PlayerPrefs.Save(); }
// Use this for initialization void Start() { MainMenuCanvas.enabled = true; SettingsCanvas.enabled = false; CreditsCanvas.enabled = false; HighscoreCanvas.enabled = false; NewHighscoreCanvas.enabled = false; GameManager.LoadSettings(); HighscoreScript.LoadHighscores(); UpdateHighscoreTable(); if (tempScore.GetScore() > (int)0) { scoreText.text = "Final Score: " + tempScore.GetScore(); foreach (ScoreData s in HighscoreScript.highscores) { if (s != null) { if (tempScore.GetScore() > s.GetScore()) { MainMenuCanvas.enabled = false; NewHighscoreCanvas.enabled = true; break; } } else { MainMenuCanvas.enabled = false; NewHighscoreCanvas.enabled = true; break; } } } AudioToggle.isOn = GameManager.PlayAudio; TutorialToggle.isOn = GameManager.DisplayTutorial; versionText.text = "Version " + Application.version; }
public PlayerData(ScoreData data) { score = data.GetScore(); coins = data.GetCoins(); }
// Update is called once per frame void Update() { text.text = a.GetScore().ToString(); }
public ScoreValue GetScore(string uid) { return(_scoreData.GetScore(uid)); }