首页 文章

Google Play服务Unity插件显示排行榜

提问于
浏览
2

我正在使用Unity为Android和iOS构建游戏,我已将其导入:https://github.com/playgameservices/play-games-plugin-for-unity

我在Google Play控制台上创建了游戏,然后我看到了我的排行榜 . 然而,没有数据上传 - 即使我已经多次运行我的代码 - 第一次是大约4天前 . 但是,仍然没有数据 .

我能够成功登录 .

我也无法展示我想要的排行榜 .

if(GUI.Button(new Rect (Screen.width/2 - 105*u, Screen.height/3 + 450*u, 210*u, 210*u), "Score")){
                // Activate the Google Play Games platform
                PlayGamesPlatform.DebugLogEnabled = true;
                PlayGamesPlatform.Activate();
                Social.localUser.Authenticate((bool success) => {});
                Social.ReportScore(PlayerPrefs.GetInt ("best"), "CxxxxQ", (bool s) => {});
                ((PlayGamesPlatform) Social.Active).ShowLeaderboardUI("CxxxxQ");
}

1 回答

  • 1
    using google.service.game;
    GoogleGame.Instance().login (true, false);
    GoogleGame.Instance().showLeaderboards();
    

    download code

相关问题