Backups
You can create a backup using ES3.CreateBackup, and restore it using ES3.RestoreBackup.
Creating a backup will overwriting any existing backup. Restoring a backup will overwrite the original file.
Creating a backup
1 2 3 |
// Save some data and then make a backup. ES3.Save("myKey", 123, "myFile.es3"); ES3.CreateBackup("myFile.es3"); |
Restoring a backup
1 2 3 4 5 6 7 8 9 10 11 |
try { myInt = ES3.Load<int>("myInt", "myFile.es3"); } catch { if(ES3.RestoreBackup("myFile.es3")) Debug.Log("Backup restored."); else Debug.Log("Backup could not be restored as no backup exists."); } |