but if the app crashes on my ios, when I restart the app, all the changes reverted to the last time I paused the game.
for example, I played my game and got to level 9, the app crashed and when I restarted it, it was back to level 4 again (because level 4 was the last time I paused the game manually and without a crash)
Code: Select all
private void Awake()
{
if (instance == null)
{
instance = this;
file = new ES3File("myFile.es3");
scores= LoadFromFileES3("scores", -1));
}
else if (instance != this)
{
Destroy(gameObject);
}
}
public void OnApplicationQuit()
{
file.Sync();
}