Google Play服务排行榜,在我报告第一得分后无法正常工作

时间:2019-11-18 16:48:43

标签: google-play-games

所以我一直在尝试正确设置Google游戏排行榜将近2周,但是它没有任何作用,只是没有登录。然后我发布了我的游戏并再次尝试,它登录并且排行榜似乎可以正常工作,但是当代码在第一次比赛之后报告了得分时。排行榜刚刚停止工作,每次我打开排行榜都会弹出此error

我已经检查了SHA1指纹并做了很多更改。我不知道如何解决,请帮忙!

如果要检查某些内容,这是我的代码:

public class GooglePlay : MonoBehaviour
{

    // Start is called before the first frame update
    void Start()
    {
        DontDestroyOnLoad(gameObject);
        PlayGamesPlatform.DebugLogEnabled = true;

        PlayGamesPlatform.Activate();

        Authenticate();

    }

    // Update is called once per frame
    void Update()
    {

    }
    public void Authenticate()
    {
        Social.localUser.Authenticate((bool success) =>
        {

        });
    }

    public void LeaderboardAndLogin()
    {
        if (Social.localUser.authenticated)
            ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(GPGSIds.leaderboard_leaderboard);
        else
            Social.localUser.Authenticate((bool success) =>
            {
                ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(GPGSIds.leaderboard_leaderboard);
            });
    }


    public static void AddScoreToLeaderBoard()
    {
        if (Social.localUser.authenticated)
        {
            long score = System.Convert.ToInt64(Score.sharedInstance.score);
            Social.ReportScore(score, GPGSIds.leaderboard_leaderboard, (bool succes) => {

                if (succes)
                {
                    Debug.Log("Score Updated");
                    PlayGamesPlatform.Instance.LoadScores(
                 GPGSIds.leaderboard_leaderboard,
                 LeaderboardStart.PlayerCentered,
                    100,
                    LeaderboardCollection.Public,
                    LeaderboardTimeSpan.AllTime,
                 (data) =>
                 {

                 });
                }
                else
                {
                    Debug.Log("Score Update Failed");
                }
            });
        }
    }
}

0 个答案:

没有答案