public void InitFromData(DataT data) { if (IsAdditionalLoad && SHSavedData.FileExists(Filename)) { Init(data, JsonConvert.DeserializeObject <DataT>(SHSavedData.LoadSaveData(Filename))); } else { Init(data, null); } }
public void Load() { string data = SHSavedData.LoadSaveData(Filename); if (string.IsNullOrEmpty(data) == false) { Init(JsonConvert.DeserializeObject <DataT>(data), null); } else { throw new System.Exception(Filename); } }
public void Clear() { string path = SHSavedData.GetDocumentsFilePath(Filename); System.IO.File.Delete(path); }
} //以dat文件的形式来保存了数据 virtual public void Save() { SHSavedData.SaveSaveData(Filename, JsonConvert.SerializeObject(CreateSaveData())); }