Google Play 游戏排行榜或登录弹出式窗口需要很长时间才会显示

本文关键字:长时间 显示 窗口 游戏 Play 排行榜 弹出式 登录 Google | 更新日期: 2023-09-27 17:56:51

按下

按钮时调用OnButtonPress()

void OnButtonPress(){ if(PlayGamesPlatform.Instance.IsAuthenticated())
                         PlayGamesPlatform.Instance.ShowLeaderboardUI("Your_leaderboardID");
         else
                         Social.localUser.Authenticate((bool success)=>{
                             PlayGamesPlatform.Instance.ShowLeaderboardUI("Your_leaderboardID");
                         });}

问题:与其他使用 Google Play 服务的游戏相比,排行榜或登录弹出窗口需要很长时间才能出现在我的应用中!我该如何解决这个问题?是因为我的代码吗?

Google Play 游戏排行榜或登录弹出式窗口需要很长时间才会显示

在脚本Awake()方法中调用以下代码:

Social.localUser.Authenticate((bool success) => {
    // handle success or failure
});

这将在游戏开始时尝试登录,因此在尝试显示排行榜 UI 时不会花费额外的时间来进行身份验证。有关更多信息,请查看文档

希望这对:)有所帮助