x


PlayerPrefs Lmitations

Hey there everyone, I was just wondering how big PlayerPrefs can be for my using, and the maximum amount of variables I can store into it. Perhaps just an example of it's limitations?

I'm curious because I plan on having it check for a lot of things - presumably over 50 - for level items, character stats, etc. and I guess I'm just a little cautious on how to spare them.

Are they the only way to retain Game states and what not? And should I be okay with using them like crazy, or will they be a little too cost effective by doing so?

Thanks for anyone willing to lend a hand, Jordan.

more ▼

asked Nov 03 '11 at 09:10 PM

Xatoku gravatar image

Xatoku
152 73 81 88

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Read the docs ;)

http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html

Basically there are no hard limits, with exception of WebPlayer, which is limited to a 1 MB.

edit: To the second part of your question: No they are not the only way, but the easiest.

You usually use them to store preferences, settings, highscores. If you want to save a level's current state, you better write your own Serialization/Deserialization Methods. But that's a bigger topic, so just google for "Serialization C#" for tutorials and explainations

more ▼

answered Nov 04 '11 at 02:59 AM

Tseng gravatar image

Tseng
1.5k 6 8 23

Thanks! Now is there any benefits to using the Serialization/Deserialization methods oppose to just doing the stats and such in PlayerPrefs?

Nov 04 '11 at 05:49 PM Xatoku

how about working with iphone / android? it doesn't seem to work at all! http://answers.unity3d.com/questions/139856/iphone-playerprefs.html

Aug 20 '12 at 09:58 PM Cawas

i would just like to share with you an asset i came accross a while ago by a regualr answerer DontDoIt (i think) its a save component which makes saving really easy and its free, i havent used it yet but the videos ive seen makes saving a simple click of a button

Aug 20 '12 at 10:06 PM reptilebeats

i was just reading up on player pref performance or speed and came accross a forum which said over 300 will be a bit slow on ios and android however this is from last year heres their solution

http://www.previewlabs.com/writing-playerprefs-fast/

heres the page i found it on as well

http://answers.unity3d.com/questions/17873/saveload-playerprefs.html

Aug 20 '12 at 10:15 PM reptilebeats
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x295
x224
x133
x44
x24

asked: Nov 03 '11 at 09:10 PM

Seen: 1837 times

Last Updated: Aug 21 '12 at 07:46 PM