void OnGUINode(DependencyNode node, bool forceDisplay = false) { if (!node.IsChecked) { node.Check(); } if (!forceDisplay && !node.RequireDisplay) { return; } bool beginDisabledGroup = false; if (forceDisplay && !node.RequireDisplay) { EditorGUI.BeginDisabledGroup(true); beginDisabledGroup = true; } int arrowWidth = 20; int iconWidth = 16; using (new EditorGUILayout.HorizontalScope()) { GUILayout.Space(node.Space); if (node.HasDependencies) { if (GUILayout.Button((node.IsOpened ? " ▼" : " ▶︎"), GUI.skin.label, GUILayout.Width(arrowWidth))) { node.IsOpened = !node.IsOpened; } } else { if (GUILayout.Button(" ", GUI.skin.label, GUILayout.Width(arrowWidth))) { } } var rect = GUILayoutUtility.GetLastRect(); rect.x += iconWidth; GUI.DrawTexture(rect, node.Icon, ScaleMode.ScaleToFit); GUILayout.Space(iconWidth - 3); if (GUILayout.Button(node.Owner.name, GUI.skin.label)) { EditorGUIUtility.PingObject(node.Owner); } } if (node.IsOpened) { if (node.HasDependencies) { using (new EditorGUI.IndentLevelScope()) { foreach (var dependencyNode in node.Dependencies) { OnGUINode(dependencyNode); } } } } if (beginDisabledGroup) { EditorGUI.EndDisabledGroup(); } }