0

in the first test game I've developed if the player passed all the levels and win , he must enter his name ... so his name and his score will be stored in a player prefs :

enter image description here

there is another scene that displays the names and scores of all the user passed the game :

enter image description here

I've searched from the morning and try all the ways I know and finally I failed to perform this .... is it possible to display all the keys values previously stored in the player prefs ???

or can someone provide me by a JavaScript to do this ????

thanks...

1
  • To my knowledge, this is not possible.
    – nwellnhof
    Oct 27, 2013 at 15:29

2 Answers 2

2

The easiest way is to create your high score structure the way you want to, serialize it to string using json and save that string in playerprefs

use either of these to serialize

http://json.codeplex.com/
System.Runtime.Serialization.Json
1

You can use a custom script called ArrayPrefs2 on the Unity3D Wiki to store arrays of data as a value in a PlayerPref's key.

Using this method you don't need to try to figure out how to pull heaps of random PlayerPref key\values. For your case you could have two key->Value pairs as such:

HighScoresName  \\ String array
HighScoresValue \\ int array

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.