public void AddScoreToHighScoreList() { PlayerHighScore newHighScore = new PlayerHighScore(_nameField.text, _finalScore.Value); _highScoreManager.AddNewHighScore(newHighScore); _nameField.text = string.Empty; _newHighScore.SetActive(false); }
public void AddNewHighScore(PlayerHighScore newHighScore) { _highScores.Add(newHighScore); _highScores.Sort(); while (_highScores.Count > _highScoreSize) { _highScores.RemoveAt(_highScoreSize); } SaveNewData(); }
void Score() { PlayerScore = Mathf.RoundToInt(cam.transform.position.y / 2f); if (PlayerScore > PlayerHighScore) { PlayerHighScore = PlayerScore; PlayerPrefs.SetInt("High", PlayerScore); } ScoreText.text = PlayerScore.ToString(); HighScoreText.text = "High Score : " + PlayerHighScore.ToString(); // if (PlayerScore > PlayerHighScore) PlayerHighScore = PlayerScore; }
private void Awake() { pointsSystem = this; }
public void UpdateFields(int place, PlayerHighScore highScore) { _placeField.text = $"{place}."; _nameField.text = highScore._name; _scoreField.text = highScore._score.ToString(); }