From 6ae1452d791a49698c4205a056b989aaeb92e417 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期二, 09 四月 2019 11:31:55 +0800
Subject: [PATCH] Merge branch 'HazyRegion' of http://192.168.0.87:10010/r/snxxz_scripts into HazyRegion
---
Core/MapEditor/Editor/MapEditor.cs | 47 +++++++++--------------------------------------
1 files changed, 9 insertions(+), 38 deletions(-)
diff --git a/Core/MapEditor/Editor/MapEditor.cs b/Core/MapEditor/Editor/MapEditor.cs
index 94e5b7e..965aa2b 100644
--- a/Core/MapEditor/Editor/MapEditor.cs
+++ b/Core/MapEditor/Editor/MapEditor.cs
@@ -328,47 +328,18 @@
private void SaveJson()
{
var _mapData = target as Bhv_MapData;
- // string _defaultPath = EditorPrefs.GetString(LS_KEY_SAVEPATH, System.Environment.CurrentDirectory);
- // string _path = EditorUtility.SaveFilePanel("淇濆瓨鏁版嵁", _defaultPath, "map_" + _mapData.id, "ed");
- // if (string.IsNullOrEmpty(_path))
- // {
- // return;
- // }
-
- // LitJson.JsonMapper.RegisterExporter<System.Type>((v, w) =>
- // {
- // w.Write(v.FullName);
- // });
-
- // LitJson.JsonMapper.RegisterImporter<string, System.Type>((s) =>
- // {
- // return System.Type.GetType(s);
- // });
-
- // System.Action<Vector3, LitJson.JsonWriter> writeVector3 = (v, w) =>
- // {
- // w.WriteObjectStart();
- // w.WritePropertyName("x");
- // w.Write((float)v.x);
- // w.WritePropertyName("y");
- // w.Write((float)v.y);
- // w.WritePropertyName("z");
- // w.Write((float)v.z);
- // w.WriteObjectEnd();
- // };
-
- // LitJson.JsonMapper.RegisterExporter<Vector3>((v, w) =>
- // {
- // writeVector3(v, w);
- // });
- // LitJson.UnityTypeBindings.Register();
-
- // var _json = LitJson.JsonMapper.ToJson(_mapData);
- Debug.Log(_mapData.SaveJson());
+ string _defaultPath = EditorPrefs.GetString(LS_KEY_SAVEPATH, System.Environment.CurrentDirectory);
+ string _path = EditorUtility.SaveFilePanel("淇濆瓨鏁版嵁", _defaultPath, "map_" + _mapData.id, "json");
+ if (string.IsNullOrEmpty(_path))
+ {
+ return;
+ }
+ File.WriteAllText(_path, _mapData.SaveJson());
}
- private class _JsonWritter : LitJson.JsonWriter
+ private void LoadJson()
{
+ var _mapData = target as Bhv_MapData;
}
--
Gitblit v1.8.0