Describe the bug
I can't load local player score. LoadScores returns "success" but scores length is 0 and no ulb.localUserScore.value is presented.
BTW my score is uploaded and I can see it in the leaderboard.
My code:
public void getLocalPlayerScore () { if (!Social.localUser.authenticated) return; //StringBuilder output = new StringBuilder (); ILeaderboard ulb = PlayGamesPlatform.Instance.CreateLeaderboard(); ulb.id = leaderboard; ulb.SetUserFilter (new string[] { PlayGamesPlatform.Instance.localUser.id }); ulb.LoadScores ((bool usuccess) => { if (usuccess) { if (ulb.scores.Length > 0) { PlayerPrefs completedLevels = " + PlayerPrefs.GetInt("completedLevels", 0)); //loaded high passed level from play services if (gcHiScore > PlayerPrefs.GetInt("completedLevels", 0)) { BizzyBeeGames.Sudoku.GameManager.Instance.SetNumberOfCompletedLevels(gcHiScore); PlayerPrefs.SetInt("completedLevels", gcHiScore); } } else { } } else { } }); }
Versions
Unity version: 2020.3.39
Google Play Games Plugin for Unity version: 11.01
Additional context
Add any other context about the problem here.
Describe the bug I can't load local player score. LoadScores returns "success" but scores length is 0 and no ulb.localUserScore.value is presented. BTW my score is uploaded and I can see it in the leaderboard.
My code:
public void getLocalPlayerScore () { if (!Social.localUser.authenticated) return; //StringBuilder output = new StringBuilder (); ILeaderboard ulb = PlayGamesPlatform.Instance.CreateLeaderboard(); ulb.id = leaderboard; ulb.SetUserFilter (new string[] { PlayGamesPlatform.Instance.localUser.id }); ulb.LoadScores ((bool usuccess) => { if (usuccess) { if (ulb.scores.Length > 0) { PlayerPrefs completedLevels = " + PlayerPrefs.GetInt("completedLevels", 0)); //loaded high passed level from play services if (gcHiScore > PlayerPrefs.GetInt("completedLevels", 0)) { BizzyBeeGames.Sudoku.GameManager.Instance.SetNumberOfCompletedLevels(gcHiScore); PlayerPrefs.SetInt("completedLevels", gcHiScore); } } else { } } else { } }); }
Versions
Additional context Add any other context about the problem here.