// --------------------- public ScriptBackup() { this.backupConfig = new BackupConfigMode(this); this.backupSelection = new BackupSelectionMode(this); this.minSize = new Vector2(400, 200); }
// --------------------- static public BackupFileElem Create(string filename, string relFilename, BackupConfigMode config) { string targetFilename = Path.Combine(Application.dataPath, relFilename); if (!File.Exists(targetFilename)) { //Debug.Log("Target file [" + targetFilename + "] doesn't exist!!!"); return(null); } string backupCode = File.ReadAllText(filename); string targetCode = File.ReadAllText(targetFilename); if ((backupCode.Length == targetCode.Length) && backupCode.Equals(targetCode)) { //Debug.Log("Target file is the same as backed up one [" + targetFilename + "]!"); return(null); } BackupFileElem file = new BackupFileElem(config.treeView); file.name = Path.GetFileName(filename); //file.config = config; file.lang = ConvertedScript.GetScriptLang(filename); file.pathIn = filename; file.pathOut = targetFilename; file.enabled = true; return(file); }