- Home /
PlayerPrefs saving
Hello, everyone! I use some PlayerPrefs in my unity app (platforms are: iOS, Android, Windows). Now I want to release update, so it's a question: when users update there apps - will PlayerPrefs be saved? The problem is that I store the game progress in this prefs and if users will lose it after update - it will be very bad. Is there reliable information about this question? Thanks.
Answer by BerggreenDK · Jul 20, 2011 at 10:45 AM
I would, if in your situation, build 2 small test apps. Then try to save something in playerprefs from testapp1, and then see if I can read it from testapp2.
If I can read the playerprefs from another app, my guess would be that playerprefs is bound to the device/player and not the app.
Second test would be to try to update testapp1 and then read the first information again, to validate that an update does not hurt data belonging to a certain app.
I havent tried this, but this is how I would proceed without any docs telling me how Playerprefs are implemented on smartdevices.
Update
http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html
PlayerPrefs are stored in ~/Library/Preferences folder, in a file named unity.[company name].[product name].plist, where company and product names are the names set up in Project Settings. The same .plist file is used for both Projects run in the Editor and standalone players.On Mac OS X
On Windows standalone players, PlayerPrefs are stored in the registry under HKCU\Software[company name][product name] key, where company and product names are the names set up in Project Settings.
On Web players, PlayerPrefs are stored in binary files under ~/Library/Preferences/Unity/WebPlayerPrefs on Mac OS X and %APPDATA%\Unity\WebPlayerPrefs on Windows. There is one preference file per Web player URL and the file size is limited to 1 megabyte. If this limit would be exceeded, SetInt, SetFloat and SetString will not store the value and throw a PlayerPrefsException.But this doesnt say ANYTHING regarding smartdevices. Hmmm... ! My guess from this sentence: "There is one preference file per Web player URL and the file size is limited to 1 megabyte." is that its bound to the app, but just as I can change the unity3D file of a website, so should the App be able to change/update without destroying the Prefs. Thats my bet.
Thanks. Yes, I'll do tests anyway (it'll take much time if I want to simulate the real case), so now I'm just looking for other people who have expierence in this question.
Yep, I checked Android and Windows: all PlayerPrefs are saved after app upgrade. I have not any iOS device for tests right now, but I guess it works well too.
Your answer
Follow this Question
Related Questions
Audio not playing on TriggerEnter (Pic Included) 3 Answers
UI Slider, Save Values and Change Them 0 Answers
playerprefs and UI. 3 Answers
keep adding to playerprefs 1 Answer