Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by sl119 · Feb 04, 2017 at 09:50 AM · google play gamesleaderboards

Few questions about Unity3D and Google Play Leaderboards

Im starting work with the google play services, specifically with the leaderboards. I did everything according to the tutorials, but i still have a few questions.

 Social.localUser.Authenticate(authenticated =>
             {
                 if (!authenticated || !Social.localUser.authenticated)
                 {
                     throw new System.Exception();
                 }
                 
                 Social.ReportScore((long) (GameObject.FindGameObjectWithTag("Disp").GetComponent<timer>().tmp * 1000), level_key, (bool success) =>
                 {
                     if (success)
                     {
                         Social.ShowLeaderboardUI();
                     }
                     else
                     {
                         throw new System.Exception();
                     }
                 });
             });

1) Is there a way to show player not all leaderboards, but the leaderboard of current level? 2) By default leaderboards shows results between friends, can i easily switch it to global?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Akash-bhatt · Feb 04, 2017 at 03:00 PM

1)YES If you wish to show a particular leaderboard instead of all leaderboards, you can pass a leaderboard ID to the method. This, however, is a Play Games extension, so the Social.Active object needs to be cast to a PlayGamesPlatform object first:

 using GooglePlayGames;
 using UnityEngine.SocialPlatforms;
 ...
 // show leaderboard UI
 PlayGamesPlatform.Instance.ShowLeaderboardUI("Cfji293fjsie_QA");

2)Yes there is options in leaderboard to switch to global

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sl119 · Feb 05, 2017 at 05:43 AM 0
Share

Thanks for the reply, but it's not what i'm looking for. I've found better solution.

 PlayGamesPlatform.Instance.LoadScores(
             GPGSIds.leaderboard_leaders_in_smoketesting,
             $$anonymous$$erboardStart.PlayerCentered,
             100,
             $$anonymous$$erboardCollection.Public,
             $$anonymous$$erboardTimeSpan.AllTime,
             (data) =>
             {
                 mStatus = "$$anonymous$$erboard data valid: " + data.Valid;
                 mStatus += "\n approx:" +data.ApproximateCount + " have " + data.Scores.Length;
             });

It's looking much more convenient. But it doesn't works :D And im trying to fix it

avatar image sl119 · Feb 05, 2017 at 06:10 AM 0
Share

Seems that it just loads the data but i need to find a way to show this data in my UI..

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Can i use Google play services leaderboards in beta testing? 0 Answers

How can I load every score from the leaderboard? 0 Answers

play-games-plugin: Loadscores ignore leaderboard's range settings 1 Answer

Google play services leaderboard not showing any scores 2 Answers

google play service problem with a game published in alpha mode 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges