Пример #1
0
    // Use this for initialization
    void Start()
    {
        string lb = string.Format("{0,-10} {1,-10}\n", "Name", "Score");

        LeaderboardDataManager.Load();
        foreach (var score in LeaderboardDataManager.highScores)
        {
            lb += string.Format("{0,-10} {1,-10}\n", score.name, score.score);
        }

        leaderboardText.text = lb;
    }
Пример #2
0
    public void SubmitScore()
    {
        if (!isGameOver)
        {
            return;
        }

        string player_name = "Player";

        if (gameOverNameInput.text != "")
        {
            player_name = gameOverNameInput.text;
        }

        LeaderboardDataManager.Load();
        LeaderboardDataManager.addScore(new LeaderboardEntry(player_name, score));
        LeaderboardDataManager.Save();

        UnityEngine.SceneManagement.SceneManager.LoadScene(2);
    }