protected void PushCustomColors() { if (!string.IsNullOrEmpty(Attribute.Color)) { DTGUI.PushColor(Attribute.Color.ColorFromHtml()); } }
public virtual void RenderSectionHeader(DTGroupNode node) { GUILayout.Space(10); var r = EditorGUILayout.GetControlRect(false, 16); int lvl = EditorGUI.indentLevel; EditorGUI.indentLevel = Mathf.Max(0, lvl - 1); r = EditorGUI.IndentedRect(r); float off = (DTInspectorNode.IsInsideInspector) ? 12 : 0; r.x -= off; bool hasHelp = !string.IsNullOrEmpty(node.HelpURL); DTGUI.PushColor(new Color(0.8f, 0.8f, 0.8f)); var r2 = new Rect(r.x - 1, r.y - 2, r.width + off + 4, r.height + 5); DTHandles.DrawOutline(r2, Color.black); GUI.Box(r2, "", GUI.skin.box); DTGUI.PopColor(); var r3 = new Rect(r); if (hasHelp) { r3.width -= 20; } node.Expanded = GUI.Toggle(r3, node.Expanded, node.GUIContent, BoldFoldout);; if (hasHelp) { if (GUI.Button(new Rect(r2.xMax - 20, r2.y + 3, 16, 16), new GUIContent(HelpIcon), new GUIStyle())) { Application.OpenURL(node.HelpURL); } } if (node.Expanded) { GUILayout.Space(3); } EditorGUILayout.BeginFadeGroup(node.ExpandedFaded); EditorGUI.indentLevel = (node.Level <= 1) ? lvl : lvl + 1; }