public bool Save() { using (FileStream fs = ZetanUtility.OpenFile(Application.persistentDataPath + "/" + dataName, FileMode.Create)) { try { BinaryFormatter bf = new BinaryFormatter(); SaveData data = new SaveData(); SaveTime(data); SaveBag(data); SaveBuilding(data); SaveMaking(data); SaveWarehouse(data); SaveQuest(data); SaveDialogue(data); SaveTrigger(data); SaveActions(data); SaveMapMark(data); bf.Serialize(fs, data); ZetanUtility.Encrypt(fs, encryptKey); fs.Close(); MessageManager.Instance.New("保存成功!"); return(true); } catch (Exception ex) { throw ex; Debug.LogWarning(ex.Message); if (fs != null) { fs.Close(); } MessageManager.Instance.New("保存失败!"); return(false); } } }