Hi, Tony.
I would like to know what happen with the variables and save slots when you uninstall an app on android.
I noticed that some variables are reseted, but others not. I think it may be due to something in the android backups, but I'm not sure.
This is my code/possible solution:
private string LoadLocal()
{
//First time installing
if (!File.Exists(PLAYER_PATH) || string.Equals(version, "0.0.0"))
{
File.WriteAllText(PLAYER_PATH, JsonUtility.ToJson(playerSO));
PlayerPrefs.DeleteKey("version");
PixelCrushers.SaveSystem.ResetGameState();
PixelCrushers.SaveSystem.DeleteSavedGameInSlot(1);
PlayerPrefs.SetString("version", "0.0.0");
PlayerPrefs.Save();
version = PlayerPrefs.GetString("version");
Debug.Log("Primera vez que instaló");
}
if (!string.Equals(version, "1.0.4"))//Different from actual version
{
//Do something
File.WriteAllText(PLAYER_PATH, JsonUtility.ToJson(playerSO));
PlayerPrefs.DeleteKey("version");
PlayerPrefs.SetString("version", "1.0.4");//Change 1.0.0 for actual version every want to update app
PlayerPrefs.Save();
Debug.Log("Primera vez que se juega (Pudo desinstalar)");
}
string json = File.ReadAllText(PLAYER_PATH);
return json;
}
Dialogue System when uninstall on android
Re: Dialogue System when uninstall on android
Hi,
PlayerPrefs for an app are deleted when you uninstall the app unless: (1) Android is deleting as part of an app update, or (2) you're using autobackup. Since the complete save data is saved under a single key, it should be all or nothing, not possible that it deletes some variable values and not others. If variables aren't the values you expect, it's probably due to something else.
PlayerPrefs for an app are deleted when you uninstall the app unless: (1) Android is deleting as part of an app update, or (2) you're using autobackup. Since the complete save data is saved under a single key, it should be all or nothing, not possible that it deletes some variable values and not others. If variables aren't the values you expect, it's probably due to something else.