private void RealySaveData(C_DataItem dataItem) { if (dataItem.HavePassword) { C_Save.SaveByte(dataItem.Name, C_LocalPath.DataPath, dataItem.Data, c_Password); } else { C_Save.SaveByte(dataItem.Name, C_LocalPath.DataPath, dataItem.Data); } }
public void SaveData <T>(string name, T obj) { if (string.IsNullOrEmpty(name) || obj == null) { return; } byte[] data = C_Save.ConvertByte <T>(obj); SaveDataByte(name, data, false); }
public byte[] LoadStreamingAssetsDataByte(string name) { for (int i = 0; i < m_DirtyDataList.Count; i++) { if (m_DirtyDataList[i].Name == name) { return(m_DirtyDataList[i].Data); } } return(C_Save.LoadByte(name, C_LocalPath.StreamingAssetsDataPath, c_Password)); }
public T LoadData <T>(string name, T defaultValue) { for (int i = 0; i < m_DirtyDataList.Count; i++) { if (m_DirtyDataList[i].Name == name) { return(C_Save.Load <T>(name, m_DirtyDataList[i].Data, defaultValue)); } } return(C_Save.Load <T>(name, C_LocalPath.DataPath, defaultValue)); }
//兼容老数据 public string LoadData_Old(string name) { string path = Application.persistentDataPath + "/c_framework/normal/data/"; byte[] data = C_Save.LoadByte(name, path, c_Password); if (data != null) { return(Encoding.UTF8.GetString(data)); } return(""); }