public static void Save(string fileName, string content) { var path = Application.persistentDataPath + "/" + fileName; if (isEn) { var bt = MTXXTea.Encrypt(content.ToString(), K); FileUtil.WriteAllBytes(path, bt); } else { FileUtil.WriteAllText(path, content); } }
public void SaveToFile() { MTJSONObject setJs = MTJSONObject.CreateDict(); setJs.Set(SettingEnum.totalCoin.ToString(), totalCoin); setJs.Set(SettingEnum.recordCoin.ToString(), recordCoin); setJs.Set(SettingEnum.recordScore.ToString(), recordScore); setJs.Set(SettingEnum.recordBomb.ToString(), recordBomb); setJs.Set(SettingEnum.recordRound.ToString(), recordRound); setJs.Set(SettingEnum.recordMatch.ToString(), recordMatch); var bt = MTXXTea.Encrypt(setJs.ToString(), SKEY); File.WriteAllBytes(GetPath(), bt); }