Example #1
0
 public void InitFromData(DataT data)
 {
     if (IsAdditionalLoad && SHSavedData.FileExists(Filename))
     {
         Init(data, JsonConvert.DeserializeObject <DataT>(SHSavedData.LoadSaveData(Filename)));
     }
     else
     {
         Init(data, null);
     }
 }
Example #2
0
    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);
        }
    }
Example #3
0
    public void Clear()
    {
        string path = SHSavedData.GetDocumentsFilePath(Filename);

        System.IO.File.Delete(path);
    }
Example #4
0
 }                                                                    //以dat文件的形式来保存了数据
 virtual public void Save()
 {
     SHSavedData.SaveSaveData(Filename, JsonConvert.SerializeObject(CreateSaveData()));
 }