public CUpdateList Read() { if (CFile.Exists(path)) { using (StreamReader sr = new StreamReader(path, Encoding.UTF8, true)) { this.Parse(sr.ReadToEnd()); sr.Close(); } } return(this); }
protected void LoadPath(string path, System.Type type, out string relPath, out string objName) { string variant = string.IsNullOrEmpty(Variant) ? string.Empty : "." + Variant; objName = NameWithTypeToSuffix(path.Substring(path.LastIndexOf('/') + 1), variant, type); relPath = path.Substring(0, path.LastIndexOf('/')) + variant; if (!CFile.Exists(CEnv.AssetPath + "/" + relPath)) { objName = NameWithTypeToSuffix(path.Substring(path.LastIndexOf('/') + 1), string.Empty, type); relPath = path.Substring(0, path.LastIndexOf('/')); } }
protected IEnumerator DeleteOldAsset(CUpdateList needDeleteLst) { base.Event.Trigger(CAutoUpdateEvents.ON_DELETE_DISK_OLD_FILE_START); string filePath; foreach (CUpdateListField field in needDeleteLst) { filePath = CEnv.AssetPath + field.Path; if (CFile.Exists(filePath)) { base.Event.Trigger(CAutoUpdateEvents.ON_DELETE_DISK_OLD_FIELD_ACTION); CFile.Delete(filePath); } } yield return(null); base.Event.Trigger(CAutoUpdateEvents.ON_DELETE_DISK_OLD_FILE_END); }