コード例 #1
0
    public void AddScoreToHighScoreList()
    {
        PlayerHighScore newHighScore = new PlayerHighScore(_nameField.text, _finalScore.Value);

        _highScoreManager.AddNewHighScore(newHighScore);
        _nameField.text = string.Empty;
        _newHighScore.SetActive(false);
    }
コード例 #2
0
 public void AddNewHighScore(PlayerHighScore newHighScore)
 {
     _highScores.Add(newHighScore);
     _highScores.Sort();
     while (_highScores.Count > _highScoreSize)
     {
         _highScores.RemoveAt(_highScoreSize);
     }
     SaveNewData();
 }
コード例 #3
0
ファイル: HUD.cs プロジェクト: ahm0162017/BecomeLazer
    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;
    }
コード例 #4
0
 private void Awake()
 {
     pointsSystem = this;
 }
コード例 #5
0
 public void UpdateFields(int place, PlayerHighScore highScore)
 {
     _placeField.text = $"{place}.";
     _nameField.text  = highScore._name;
     _scoreField.text = highScore._score.ToString();
 }