public void Load() { StreamReader streamReader = File.OpenText(string.Format("{0}/{1}.ys", IOTOOL.Unity_Dirpath, filename_json)); string readsys = streamReader.ReadToEnd(); streamReader.Close(); Debug.Log(readsys); if (readsys != "") { //对数据进行解密,32位解密密钥 if (isRijndaelEncrypt) { readsys = IOTOOL.RijndaelDecrypt(readsys, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); } jsonInfo = JsonMapper.ToObject <JsonInfo>(readsys); } else { Sava(); jsonInfo = JsonMapper.ToObject <JsonInfo>(readsys); } }
/// <summary> /// 初始化本地文件数据操作 /// </summary> private void InitLocalLowIOFile() { IOTOOL.CreateDirectory(); if (isFirstGame) { IOTOOL.Delete(filename_json); } if (!IOTOOL.IsFileExists(filename_json)) { Debug.Log("第一次初始化数据"); IOTOOL.CreateFile("第一次初始化数据User", filename_json); jsonInfo = defaultDataScriptObject.StaicJsonInfo; Sava(); } else { Debug.Log(filename_json + " 文件已经存在!!"); } Load(); }