Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by theredace · Sep 24, 2014 at 08:44 PM · social

Trying to understand the social class

I'm well aware of prime31's plugins, but I'm trying to learn and would rather implement leaderboards myself (plus save the money). As I'm sure people have stated ad naseum, Unity's Social class is woefully undocumented. It seems very simple overall, but it's just not explained how everything works.

I think I have GameCenter working correctly in my game, but I'm not entirely sure, so I have some questions for anyone who can help. I've read tons of tutorials and such, but none of them are good at explaining in detail.

  1. What exactly is happening when I call Social.localUser.Authenticate()? I thought this was actually pinging Apple's servers to connect to GameCenter, but I've realized that it still authenticates even with no internet connection. Is this just checking that the player is logged into GameCenter (which apparently doesn't require an internet connection)?

  2. What is the purpose of Social.CreateLeaderboard()? If a leaderboard exists on Apple's servers, why am I creating one locally? Is it like a container for the data being pulled from GameCenter? Every tutorial I've seen shows this being done before Social.ShowLeaderboardUI(), and then creating a name (id) for the newly created leaderboard. Do I need to do this just once when starting my game, or do I need to do it again every time I show the leaderboards?

  3. The only things I'm currently using in my implementation of a leaderboard are Social.localUser.Authenticate(), Social.CreateLeaderboard(), Social.ShowLeaderboardUI(), and Social.ReportScore. But there are other things in the Social class that make me think it's more complicated and I'm missing something. Like what about Social.LoadScores() and Social.LoadUsers(). Should I be using those for something?

  4. My understanding is that the Social class is meant to apply to both GameCenter and Google Play Game Services with the same code. But I don't understand how that works when using Social.ReportScore() and I have to list the leaderboard name. If the iOS and Android leaderboard names are different then am I just expected to detect the platform and branch the code here? Note that I haven't tried this on Android yet so I don't even know if my code works there.

  5. Currently, if my device has no internet connection AND the user is not logged into GameCenter, none of the leaderboard stuff appears. I was thinking there would be an automated error message or something, but attempting to authenticate just has no reaction in game (so in my case it looks like a button that does nothing). Do I have to detect this authenticate fail state on my own and display a message, or does Unity connect to built-in OS messaging that I can tie into?

  6. Lastly, in the event that the player uninstalls and re-installs the app (which wipes the PlayerPrefs where I locally store the highscore), is there a way to check the online leaderboards to get a player's previous highscore and pull it into the game? I would expect a Social.GetScore() method, but there isn't one. If I can't do this then the game will attempt to post scores to the leaderboard that are smaller than previous ones posted by the same user... and I'm not even sure what will happen in that case.

Sorry for the wall of text. Any help is much appreciated.

Comment
Add comment · Show 1
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 theredace · Sep 25, 2014 at 04:39 PM 0
Share

Can anybody help?

0 Replies

· Add your reply
  • Sort: 

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

25 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Send email with attachment 1 Answer

Post Data on Twitter 1 Answer

Calling an android method from Unity3D with a JAR plugin 0 Answers

Share text message on selected media 1 Answer


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