排行榜不工作Unity 2D游戏

时间:2015-11-18 02:34:44

标签: c# unity3d

我按照此链接中的说明进行操作

http://shaneobrien.ie/official-google-play-game-services-plugin/

在我的游戏中分配排行榜,但它不起作用。我的排行榜按钮代码:

public void LeaderBoard ()
{
    Social.localUser.Authenticate ((bool success) =>
    {
        if (success) {
            Debug.Log ("You've successfully logged in");
        } else {
            Debug.Log ("Login failed for some reason");
        }
    });

    if (Social.localUser.authenticated) {
        Social.ReportScore (PlayerPrefs.GetInt ("BestScore"), leaderboard, (bool success) =>
        {
        if (success) {
                ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI (leaderboard);
            } else {
                Debug.Log ("Login failed for some reason");
            }
        });
    }
}

我的日志:

Login failed for some reason UnityEngine.Debug:Log(Object) 
LoadSceneScript:<LeaderBoard>m__EF(Boolean) (at Assets/Script/LoadSceneScript.cs:256)
GooglePlayGames.BasicApi.DummyClient:Authenticate(Action`1, Boolean) (at Assets/GooglePlayGames/BasicApi/DummyClient.cs:33) 
GooglePlayGames.PlayGamesPlatform:Authenticate(Action`1, Boolean) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:278) 
GooglePlayGames.PlayGamesPlatform:Authenticate(Action`1) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:249) 
GooglePlayGames.PlayGamesLocalUser:Authenticate(Action`1) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesLocalUser.cs:48) 
LoadSceneScript:LeaderBoard() (at Assets/Script/LoadSceneScript.cs:251) 
UnityEngine.EventSystems.EventSystem:Update()

0 个答案:

没有答案