|
|
@ -11,7 +11,9 @@ namespace JXSoft { |
|
|
|
{ |
|
|
|
{ |
|
|
|
public TextAsset JsonFile; |
|
|
|
public TextAsset JsonFile; |
|
|
|
AnimBool m_ShowExtraFields; |
|
|
|
AnimBool m_ShowExtraFields; |
|
|
|
public Dictionary<string, string> keyValuePairs; |
|
|
|
private JsonReader reader; |
|
|
|
|
|
|
|
public Dictionary<string, string> keyValuePairs = new Dictionary<string, string>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MenuItem("JXSoft/Loader/JsonFileLoader")] |
|
|
|
[MenuItem("JXSoft/Loader/JsonFileLoader")] |
|
|
|
static void Init() |
|
|
|
static void Init() |
|
|
@ -30,17 +32,24 @@ namespace JXSoft { |
|
|
|
JsonFile = (TextAsset)EditorGUILayout.ObjectField("JsonFile", JsonFile, typeof(TextAsset), true); |
|
|
|
JsonFile = (TextAsset)EditorGUILayout.ObjectField("JsonFile", JsonFile, typeof(TextAsset), true); |
|
|
|
if (GUILayout.Button("AnalyzeJsonFile")) |
|
|
|
if (GUILayout.Button("AnalyzeJsonFile")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (JsonFile != null) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (GUILayout.Button("Clear")) { |
|
|
|
|
|
|
|
keyValuePairs.Clear(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (JsonFile != null) { |
|
|
|
|
|
|
|
reader = new JsonReader(JsonFile.text); |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
while (reader.Read()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
JsonData jsonData = JsonMapper.ToObject(JsonFile.text); |
|
|
|
string type = reader.Value != null ? reader.Value.GetType().ToString() : ""; |
|
|
|
foreach (string key in jsonData.Keys) |
|
|
|
string value = reader.Value != null ? reader.Value.ToString() : ""; |
|
|
|
{ |
|
|
|
EditorGUILayout.BeginHorizontal("Label"); |
|
|
|
Debug.Log(jsonData[key].GetJsonType()); |
|
|
|
EditorGUILayout.TextField("Type", type); |
|
|
|
for (int i = 0; i < jsonData[key].Count; i++) { |
|
|
|
EditorGUILayout.TextField("Token", reader.Token.ToString()); |
|
|
|
Debug.Log(jsonData[key][i].GetJsonType()); |
|
|
|
EditorGUILayout.TextField("Value", value); |
|
|
|
} |
|
|
|
EditorGUILayout.EndHorizontal(); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|