Как написать лучший результат в GameCenter Unity IOS? - PullRequest
0 голосов
/ 04 сентября 2018

Я хочу создать таблицу лидеров в моей игре. Я его создаю, но когда открываю с помощью кнопки LeaderBoard, там не записывается.

private void Start () {

    Social.localUser.Authenticate (success => {
        if (success) {
            Debug.Log ("Authenticated, checking achievements");

            // Request loaded scores, and register a callback for processing them
            ILeaderboard leaderboard = Social.CreateLeaderboard();
            leaderboard.id = "secretID";
            leaderboard.LoadScores(result => {
                Debug.Log("Received " + leaderboard.scores.Length + " scores");
            });
        }
        else
            Debug.Log ("Failed to authenticate");
    });
}


public void OpenLeaderboard() {
    Social.ReportScore (15, "secretID", result => {
            Debug.Log(result ? "Reported score successfully" : "Failed to report score");
    });

    UnityEngine.SocialPlatforms.GameCenter.GameCenterPlatform.ShowLeaderboardUI ("grp.warior.game", TimeScope.Week);
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...