Example #1
0
    void DeleteOldBackupFolders()
    {
        if (!Directory.Exists(Application.persistentDataPath + "/backups/"))
        {
            return;
        }

        string[] BackupFolders = Directory.GetDirectories(Application.persistentDataPath + "/backups/");
        foreach (string BackupFolder in BackupFolders)
        {
            if (ES3.Load("FileDeleted", "/backups/" + BackupFolder + "/info.txt", false))
            {
                DateTime deletedon         = ES3.Load <DateTime>("DeletedOn", "saves/backups/" + BackupFolder + "/info.txt");
                TimeSpan TimeSinceDeletion = DateTime.Now - deletedon;
                if (TimeSinceDeletion.Days > Settings.Get("DaysToKeepBackupsOfDeletedSaves", 10))
                {
                    ES3.DeleteDirectory("saves/backups/" + BackupFolder);
                    Directory.Delete(Application.persistentDataPath + "/backups/" + BackupFolder);
                    Debug.Log("deleted old backups for " + BackupFolder);
                }
            }
        }
    }
Example #2
0
 public override void Enter()
 {
     ES3.DeleteDirectory(directoryPath.Value, GetSettings());
 }
Example #3
0
 public void yes()
 {
     AreYouSure.SetActive(false);
     Success.SetActive(true);
     ES3.DeleteDirectory("");
 }