user2947684
user2947684

Reputation: 91

Google Play Services Unity Plugin Show Leaderboard

I am building a game for Android and iOS with Unity, and I have imported this: https://github.com/playgameservices/play-games-plugin-for-unity

I have created the game at the Google play Console, and I see my leaderboard. No data is uploaded however - even tho I have ran my code several times - first time was about 4 days ago. But still, no data is there.

I am able to log in successfully.

I am nor able to show the Leaderboard, which I would like to.

if(GUI.Button(new Rect (Screen.width/2 - 105*u, Screen.height/3 + 450*u, 210*u, 210*u), "Score")){
                // Activate the Google Play Games platform
                PlayGamesPlatform.DebugLogEnabled = true;
                PlayGamesPlatform.Activate();
                Social.localUser.Authenticate((bool success) => {});
                Social.ReportScore(PlayerPrefs.GetInt ("best"), "CxxxxQ", (bool s) => {});
                ((PlayGamesPlatform) Social.Active).ShowLeaderboardUI("CxxxxQ");
}

Upvotes: 2

Views: 3864

Answers (1)

smileface
smileface

Reputation: 56

using google.service.game;
GoogleGame.Instance().login (true, false);
GoogleGame.Instance().showLeaderboards();

download code

Upvotes: 1

Related Questions