| | |
| | | { |
| | | Export(); |
| | | } |
| | | if (GUILayout.Button("导入", gUISkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | MapData.LoadFormFile(10010); |
| | | } |
| | | EditorGUILayout.EndHorizontal(); |
| | | |
| | | /// -------------------------------------------------------------------------------- |
| | |
| | | using (var _binaryWriter = new BinaryWriter(_fileStream)) |
| | | { |
| | | _mapData.Save(_binaryWriter); |
| | | EditorPrefs.SetString(LS_KEY_SAVEPATH, Directory.GetParent(_path).FullName); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | var _mapData = target as Bhv_MapData; |
| | | string _defaultPath = EditorPrefs.GetString(LS_KEY_SAVEPATH, System.Environment.CurrentDirectory); |
| | | string _path = EditorUtility.SaveFilePanel("导出数据", _defaultPath, "map_" + _mapData.id, "bytes"); |
| | | string _path = EditorUtility.SaveFilePanel("导出数据", _defaultPath, MapData.MapEditorData_Suffix + _mapData.id, "bytes"); |
| | | if (string.IsNullOrEmpty(_path)) |
| | | { |
| | | return; |
| | |
| | | { |
| | | using (var _binaryWriter = new BinaryWriter(_fileStream)) |
| | | { |
| | | _mapData.Save(_binaryWriter); |
| | | _mapData.Export(_binaryWriter); |
| | | } |
| | | } |
| | | } |
| | |
| | | using (var _binaryReader = new BinaryReader(_fileStream)) |
| | | { |
| | | _mapData.Load(_binaryReader); |
| | | EditorPrefs.SetString(LS_KEY_SAVEPATH, Directory.GetParent(_path).FullName); |
| | | } |
| | | } |
| | | } |