Hi I am creating a small game with Unity3d. But now I have trouble saving some variables. Now I am using the following code
void Awake(){
proiettili = PlayerPrefs.GetFloat ("PallottoleOgniSecondo");
}
void OnApplicationQuit(){
PlayerPrefs.SetFloat ("PallottoleOgniSecondo", proiettili);
PlayerPrefs.Save();
}
This way I can save the variable, but only when I try on unity, if I try does not work on Android. you know how I can fix?
This is how you do it for an example class called MyClass
Check your permissions of Android project,if you had added "android.permission.WRITE_EXTERNAL_STORAGE".
You should try it like this
I've tried this in my project for a Web and WebGL build, if you need to know about serialization I could give you an example