/// <summary> /// Draw a section, a header-like usefull to order your editor. /// </summary> /// <param name="_label">Label to display.</param> /// <param name="_lineWidth">Width of the lines surrounding the label (in pixels).</param> /// <param name="_heightSpace">Space on top and bottom of the section (in pixels).</param> public static void Section(GUIContent _label, float _lineWidth, float _heightSpace) { // Get section rect Rect _position = EditorGUILayout.GetControlRect(true, (EditorGUIUtility.singleLineHeight + _heightSpace) * 2); // Draw it EditorGUIEnhanced.Section(_position, _label, _lineWidth); }
// Make your own GUI for the decorator public override void OnGUI(Rect _position) { SectionAttribute _attribute = (SectionAttribute)attribute; EditorGUIEnhanced.Section(_position, _attribute.Label, _attribute.LineWidth); }