- Home /
Question by
siddharth3322 · Jul 29, 2017 at 09:04 AM ·
androidgoogle play gamesleaderboard
Show Leaderboard Score Directly - Google Play Service
I want to show leaderboard score directly as player press on leaderboard icon as like this:
When I was showing a leaderboard it just displaying, list of leaderboard. I want to see actual score directly.
Here is my code:
public void ShowLeaderboard ()
{
if (Social.localUser.authenticated)
Social.ShowLeaderboardUI ();
else {
// authenticate user:
Social.localUser.Authenticate ((bool success) => {
// handle success or failure
if (success) {
Debug.Log ("Login Success....");
PostHighScoreOnLeaderBoard();
Social.ShowLeaderboardUI ();
} else {
Debug.Log ("Login Failed....");
}
});
}
}
How can I show directly a players score?
pixelrunner-leaderboard.png
(105.1 kB)
pixelrunner-monster-leaderboard.png
(82.7 kB)
Comment
Best Answer
Answer by hasitha · Nov 05, 2017 at 06:12 PM
You can use following method in Google Play Games Services plugin.
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
public static void ShowMyLeaderboard{
// show specific leaderboard UI
PlayGamesPlatform.Instance.ShowLeaderboardUI("YOUR_LEADERBOARD_ID");
}