How can I save and read data on Android?
1 Answer
1You can use the PlayerPrefs class of Unity to store Ints, Floats and Strings. The documentation for this is at: http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html
If you need to store your own data types you can use System.IO classes of the .net (mono) library. The actual paths that you can use are located at Application.persistentDataPath and Application.temporaryCachePath.
You application needs to have permissions in the AndroidManifest.xml to write to storage. That can be set in Player Settings -> Android Tab -> Other Settings -> Configuration -> Force SD-Card permission.
I can't find the option to change the permissions in the new version of Unity. Does anybody know where it moved to?
– shieldgenerator7