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
0
Question by Noah-1 · May 07, 2014 at 10:12 AM · playerprefsserializationsavekeys

Local High-Scores with PlayerPrefs?

Hi there guys, so my latest IOS project is going to have a very basic High-Scores scene. It is going to be something like this:

Player1..........999

Player2..........888

Player3..........777

Player4..........666

Player5..........555

I want the scene to display only the highest 5 scores achieved (locally).

After the user plays a round and looses, the game over screen pops with a text field to enter your name, that name is then saved with the player score using PlayerPrefs and displayed with GUI on my high scores scene, everything fine up to this point.

What i want to achieve is every time the user plays, the "new score" is added to the leaderboard, until it has five scores saved, then it will just add the scores that are higher to one of the previously saved scores, there is a perfect example of what i am looking for here and I found a similar question here, the replies are about something called ArrayPrefs2 but i don´t know if this is the right approach or if I am just making this harder than it should be. Any ideas?

Thanks for the help!

Comment
Add comment · Show 2
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 flamy · May 08, 2014 at 08:06 AM 2
Share

check this answer !! http://answers.unity3d.com/questions/252209/high-score-list.html

avatar image Noah-1 · May 09, 2014 at 03:42 AM 0
Share

I checked that one before and it works really good, but my game is written is js and i wasn´t able to rewrite that script.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by PTerto · May 07, 2014 at 03:08 PM

try this post...http://answers.unity3d.com/questions/27973/idiots-guide-to-player-prefs.html

Comment
Add comment · 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

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

23 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

Related Questions

whats the best way to save a large list of variables? 1 Answer

Save/load playerprefs 2 Answers

How do I save a custom class of variables to playerprefs? 2 Answers

Character Positions Not Serializing or Loading Properly? 1 Answer

Serialization of Animator state 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