Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity PlayerPrefs saving

Tags:

unity3d

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?

like image 248
Zura Avatar asked Jul 20 '11 10:07

Zura


People also ask

Can you save an array to PlayerPrefs?

You can't. PlayerPrefs doesn't support arrays.

What is the best way to save data Unity?

Platform-Independent: One way of saving data in Unity3D in a Platform-independent way is to use the PlayerPrefs class. PlayerPrefs is a static class and it is very easy to use but not reliable. PERSISTENCE - SAVING AND LOADING DATA using DontDestroyOnLoad, PlayerPrefs, and data serialization Video Tutorial by unity.

How do I use PlayerPrefs in Unity?

It works by storing a string, float or integer value to disk with a key, which is a text string that's used to store and recall a preference. For example, to save an integer, simply call the Set Int function of the Player Prefs class and pass in the key you want to use to retrieve it again.


1 Answers

How will you release this update? A new version of the application, or new content streamed in through asset bundles?

If it's a new version of the application, but it's installed as an update and overwrites the old version, then playerprefs will remain unchanged. If it's installed seperately however, the saved data will be lost.

If you're using asset bundles, no worries, nothing will break. ;)

like image 64
jbnicolai Avatar answered Sep 28 '22 11:09

jbnicolai