示例#1
0
 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);
     }
 }
示例#2
0
        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);
        }
示例#3
0
        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));
        }
示例#4
0
        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));
        }
示例#5
0
        //兼容老数据
        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("");
        }