void ShowActions(AISAction root) { GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); string n = root.name + ": " + root.GetMinScore() + " - " + root.GetMaxScore(); if (root.children.Count == 0) { EditorGUILayout.LabelField(n); } else { root.showChildren = EditorGUILayout.Foldout(root.showChildren, n); } if (GUILayout.Button("Select")) { selectedAction = root; } if (root.order != 0) { if (GUILayout.Button("Eliminate")) { EliminateAction(root); } } GUILayout.EndHorizontal(); if (root.showChildren) { for (int d = 0; d < root.children.Count; d++) { ++EditorGUI.indentLevel; ShowActions(root.children[d]); --EditorGUI.indentLevel; } } GUILayout.EndVertical(); }