In the process of moving an iOS title to Windows Store - every time I run the build via VS2012, or by clicking on the icon in Start the saved playerprefs are reset.
I’m def. calling .Save() when I make changes, but nothing seems to stick. I’m sure it’s something simple, but I’ve no idea what.
Any clues?
Thanks,
PY
PlayerPrefs for Windows Store Apps are saved here - C:\Users<user>\AppData\Local\Packages<your app name>
I think whenever you change something in your project, and VS has to rebuilt it, it will delete that folder, thus clearing player prefs.
This shouldn’t be happening, are you sure you’re calling - PlayerPrefs.Save ?
Also there was a bug in 4.2 I think, that PlayerPrefs were loaded after OnEnable function, meaning they’re only available in Start or later function. Maybe you’re seeing this problem.
Calling the Save method after a change.
Using the latest 4.2.2 Unity build VS2012 – I’ll investigate the folder and see if they are showing up.
So, the file shows up and from some quick testing, it seems that you are right - I can’t load prefs before a Start function - which is a bit of a shame - I’ll have to try moving things around and see what can be done.
Ok, confirmed - I moved my LoadPrefs call to a Start function on a script with high-priority and had it then call my old Awake code to set everything up. This read the prefs file in correctly. Looks like that issue is still in 4.2.2.
Thanks for the help.
PY