- Home /
PlayerPrefs defaults for install
Pre-Warning: Yes I've done a google-search. Yes I've looked through Unity Answers. Please don't patronize me unless you want to be reported. ^.^
Basically what the title suggests: I'd like to have a default player prefs upon the game starting. While I realize that I could, by hand, enter in all the data with a onetime script I'd like to know if there is a more elegent solution.
I've been creating GUI elements that can save their location and data in playerprefs so that I can on-the-fly change the variables during Unity's Play, they will save their current data, and load it when next the game is "Played"
For example: the rect data on a texture is compressed into a string array and saved to gameObject.name + "_" + SpecificID; if I press S while the editmode is enabled.
Next it loads that data and automatically places the texture, based on my ealier actions.
All this is working quite well, but since PlayerPrefs is the only (to my knowledge) available data saving option inherant to unity, I'd like to investigate my options before building a whole program based on a system that won't really work as soon as I try to export it.
Could I somehow save the playerpref data to be loaded when i export the whole thing to windows, so that all the data is intact?
Or is there an option I've missed in my exploration to keep the variables you input during play when you exit the program simulation?
Basically I'm sick of writing down all my rect data after i get all my menus and buttons in place and am looking for a intelligent solution.
Thanks!
Answer by getyour411 · Aug 21, 2013 at 08:16 PM
Look at the (free) Unity Serializer by whydoidoit
Just tried to add this to my unity... crashed the first time. Re-installed and tried again, this time it simply won't pull up plugin menus or work at all. I'd love to find a serialization program that came with a tutorial that didn't make me wonder if I had lost my mental faculties... I guess its time to start the search.
This Serializer gem is used by hundreds, maybe thousands of Unity folks so I'd bet the issue is unique to your setup. Create a new project and import the Serializer - if there are still issues ask for help on anything specific that's reported.
Well I have a standard install, I tried playing with things but as soon as I clicked on the wizard it started spitting the same error code and I had to shutdown unity.
However I did find a "Serializer gem" of a different origin. Its a basic X$$anonymous$$L tutorial. I plugged the code in and had a working understanding of X$$anonymous$$L inside of an hour. This little tutorial included a working code example, as well as enough information to get me off the ground. It doesn't include all the functions a person could need but its a darn sight easier to understand than anything else I've run across.
Since you were patient, and I've seen enough links pointing to that plugin I'll mark this as correct. I can't endorse it personally, but I'm sure it'll help folks. Have a awesome day.
Your answer
Follow this Question
Related Questions
Saving with PlayerPrefs? How it works? 1 Answer
Saving and loading game with PlayerPrefs 1 Answer
Having issues with PlayerPrefs... 2 Answers
Save Datasets at runtime 2 Answers