Page 1 of 1

Keep losing my saves in Player Prefs

Posted: Tue Nov 29, 2022 4:59 pm
by teq
Hi there! I have many users of my app and sometimes they complain about losing app's settings state. I use ES3 with Player Prefs, AES enc, no compression. I use ES only for saving strings like "theme" -> "dark". Nothing more.
I just create ES3File with ES3Settings

Code: Select all

_userES3Settings = new ES3Settings(ES3.EncryptionType.AES, ES3_ENCRYPTION_PASSWORD)
                                                           {
                                                               location = ES3.Location.PlayerPrefs
                                                           }
es3DefaultFile = new ES3File(UserES3Settings);
and then

Code: Select all

es3DefaultFile.Save<T>(settingName, value); 
and

Code: Select all

es3DefaultFile.Sync(UserES3Settings);
In this article stated that Plaer Prefs "can be deleted by accident since they’re saved outside of the project and managed by your OS".
What do you recommend for better data integrity?

Re: Keep losing my saves in Player Prefs

Posted: Tue Nov 29, 2022 6:50 pm
by Joel
Hi there,

Is there any reason you’re using PlayerPrefs rather than the default option of File?

All the best,
Joel

Re: Keep losing my saves in Player Prefs

Posted: Tue Nov 29, 2022 7:22 pm
by teq
Joel wrote: Tue Nov 29, 2022 6:50 pm Hi there,

Is there any reason you’re using PlayerPrefs rather than the default option of File?

All the best,
Joel
Yes, i tried File few years ago and also faced with the same issue.

Re: Keep losing my saves in Player Prefs

Posted: Tue Nov 29, 2022 8:09 pm
by Joel
As we’ve had no other reports of people losing their data I’m afraid it’s difficult for me to comment on what’s happening.

The only situations I know of where data is removed without the player deleting it themselves is if the bundle identifier of the app changes between updates, or if the app is uninstalled.

All the best,
Joel