in Scripts/Editor/Utility/WitUnderstandingViewer.cs [369:418]
private void DrawNode(WitResponseNode childNode, string child, string path, bool isArrayElement = false)
{
if (childNode == null)
{
return;
}
string childPath;
if (path.Length > 0)
{
childPath = isArrayElement ? $"{path}[{child}]" : $"{path}.{child}";
}
else
{
childPath = child;
}
if (!string.IsNullOrEmpty(childNode.Value))
{
GUILayout.BeginHorizontal();
GUILayout.Space(15 * EditorGUI.indentLevel);
if (GUILayout.Button($"{child} = {childNode.Value}", "Label"))
{
ShowNodeMenu(childNode, childPath);
}
GUILayout.EndHorizontal();
}
else
{
var childObject = childNode.AsObject;
var childArray = childNode.AsArray;
if ((null != childObject || null != childArray) && Foldout(childPath, child))
{
EditorGUI.indentLevel++;
if (null != childObject)
{
DrawResponseNode(childNode, childPath);
}
if (null != childArray)
{
DrawArray(childArray, childPath);
}
EditorGUI.indentLevel--;
}
}
}