- Home /
Player Prefs Mixed Array
I can save each item individually to PlayerPrefs, but I thought using an array for each part: stats, vitals, skills, etc would be a better way to go. I found a great script that can do it, but I still need to create the arrays. The trouble is that I have strings, floats and ints. Is there an array type I can use to keep the different parts all together? Or am I just over thinking the whole process?
Thanks!
Answer by Eric5h5 · Apr 23, 2012 at 05:44 PM
You should use something other than PlayerPrefs for that sort of thing, namely writing to a file, possibly using XML.
Why is a db or X$$anonymous$$L file better than using PlayerPrefs?
Because PlayerPrefs stores things where the OS stores application preferences. On windows in the Registery , on $$anonymous$$ac OSX plists, etc.
Its great for things you do infrequently like remembering which was last game save or game options.
See the thread on game saves.
PlayerPrefs is quite limited. It good for small stuff, but when you get to the point of storing arrays of custom classes, you're beyond what PlayerPrefs can reasonably do.
@Gilead: No the 1 meg limit exists only in the webplayer. In a webbuild however you don't have much alternatives beside serverside storage. Webpage-cookies would be another way, but they are even more limited :D
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
How do I save a custom class of variables to playerprefs? 2 Answers
Can someone tell me what is wrong with this? 2 Answers
Using PlayerPrefs to save a C# Generic List 1 Answer
Multiple Cars not working 1 Answer