Hi,
today we implemented the Google Play Services to our Android project. We use the Leaderboard to save the scores of the Users. This works very well!
My Problem:
When I press the button to show the Highscore, the Leaderboard appears. But when I now use the back-button to get back to my game, the Leaderboard appears again. And when I now press the back-button again, it does not appear again. So you can say:
Everytime when I open the Leaderboard per touch on the button, the Leaderboard opens twice.
Is this a known issue? I was not able to fix it. I work on this issue since 4h
Also google was not very helpful.
I call the Highscore with this Code (please have a look on line number 25):
void Update ()
{
if (Input.touchCount == 0)
return;
Touch touch = Input.touches[0];
Ray ray = Camera.main.ScreenPointToRay(touch.position);
RaycastHit hit;
if (Physics.Raycast (ray, out hit, 1000f))
{
if (hit.transform.name == transform.name)
{
if(scene == SelectScene.Exit)
{
((PlayGamesPlatform) Social.Active).SignOut();
Application.Quit();
}
else if(scene == SelectScene.Highscore)
{
((PlayGamesPlatform) Social.Active).ShowLeaderboardUI("LEADERBOARD-ID");
// Application.LoadLevel("Hauptmenu");
}
else
Application.LoadLevel(scene.ToString());
}
}
}