Exemple #1
0
    //uploads highscore to highsoreWriter
    public void uploadHighscore()
    {
        int    score = PlayerPrefs.GetInt("PlayerScore");
        string name  = PlayerPrefs.GetString("Username");

        Debug.Log(name);
        HighscoreEntry newEntry;

        newEntry.entryName  = name;
        newEntry.entryScore = score;

        HighScoreWriter.AddEntry(newEntry);
    }
    //Loads highscores from file and updates UI
    private void OnEnable()
    {
        HighscoreSaveData savedScores = HighScoreWriter.GetSavedScores();

        UpdateUI(savedScores);
    }