Question by
AlexTselikas · Dec 02, 2015 at 04:36 PM ·
saveloadgoogle play gamesleaderboard
Store/Load highscore or stats from google play games?
Hi there, i integrated Google Play Games to my game and i got the leaderboard and posting to the leaderboard working.I am interested being able to load the highscore when a player updates my app or uninstalls it and installs it again,since it gets lost.Also,is there a way to also save bools and stuff for specific player.For example if a player unlocks something,i want the unlock to be tied with the account(it's not a purchase).I am kinda of a newbie.
Here is my code for the leader board
void Start() {
PlayGamesPlatform.Activate();
Social.localUser.Authenticate((bool success) =>
{
if (success)
{
Debug.Log("logged in");
}
else
{
Debug.Log("logging in failed");
}
});
}
// Update is called once per frame
void Update () {
}
public void PostToLeaderboard()
{
Social.ReportScore(ScoreManager.instance.highScoreCount, "CgkI5ZnTgM0TEAIQAQ", (bool success) =>
{
//Added score to the leaderboard;
});
}
public void ShowLeaderboard()
{
((PlayGamesPlatform)Social.Active).ShowLeaderboardUI("CgkI5ZnTgM0TEAIQAQ");
}
#endif
}
Comment
Your answer
Follow this Question
Related Questions
OnApplicationQuit 2 Answers
How do I save 2 different string lists? 1 Answer
How to save and load complete gameobjects 0 Answers
playgame service plugin integration 1 Answer