In Unity on OSX I am trying to edit the PlayerPrefs values in the unity.companyName.productName.plist, but every time I start the game they get overwritten with the old values. Is there a way to do this directly?
2 Answers
2Spent some time battling with this, and learned that OS X Mavericks caches prefs in memory. Any manual edits to the plist are ignored. In addition to editing the plist while Unity is closed, you must also invalidate the cache. In my experience, this works:
Quit Unity, make your edit, and then issue these commands in a terminal:
defaults read ~/Library/Preferences/your.plist.here
defaults read your.plist.here
Yes, both commands, and obviously replace your.plist.here with the filename of your plist. Bonus points: make a backup of your plist before trying any of this.
Man this has been annoying me for ages. I didn't need the second defaults read command, but otherwise it worked a treat.
can't upvote it, but at least i'll leave a comment here: you've saved my day with this 'defaults' command. thanks.
– begrayUsing the defaults command is the correct answer since Mavericks, due to all the voodoo caused by cfprefsd.
– orbQuit the Unity editor before editing the .plist file.
That's weird. That implies that Unity keeps a separate, secret settings file somewhere else that it can use for backups!
– syclamoth