【问题标题】:Google Play Games leaderboard customGoogle Play 游戏排行榜自定义
【发布时间】:2019-03-19 06:15:27
【问题描述】:

我想实现这个 "我的排名:前 13%(25034 排名)"

我试过的↓

Social.LoadScores("CgkI1...", scores => {...})

:“scores.Length”最多返回 25。

ILeaderboard lb = Social.CreateLeaderboard();
lb.id = "CgkI1...";
uint max_player = lb.maxRange;

:失败..

我不知道排行榜的玩家人数和我的排名。 请帮帮我,我该怎么办..

【问题讨论】:

    标签: unity3d google-play-games


    【解决方案1】:

    我靠自己成功了:

            ILeaderboard lb =  PlayGamesPlatform.Instance.CreateLeaderboard();
            lb.id = "CgkI1...";
            lb.userScope = UserScope.Global;
            lb.range = new Range(1,10);
            lb.timeScope = TimeScope.AllTime;
    
    
            lb.LoadScores(scores =>
            {
                uint all_player = lb.maxRange;
                int my_rank = lb.localUserScore.rank;
                decimal percent = (decimal)my_rank / (decimal)all_player;
    
                text.text = scores.ToString() + "\nAllPlayer: " + all_player + "\nMyRank: " + my_rank + "\nMyScore: " +lb.localUserScore.value.ToString() + "\nPercent: " + percent + "%";
            });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-22
      • 2016-08-09
      • 1970-01-01
      • 2017-01-30
      • 2013-05-12
      • 1970-01-01
      • 2015-07-14
      • 2016-02-11
      相关资源
      最近更新 更多