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); } } } }
public override void Enter() { ES3.DeleteDirectory(directoryPath.Value, GetSettings()); }
public void yes() { AreYouSure.SetActive(false); Success.SetActive(true); ES3.DeleteDirectory(""); }