Horizontal Group Attribute

HorizontalGroup is used group multiple properties horizontally in the inspector. The width can either be specified as percentage or pixels. All values between 0 and 1 will be treated as a percentage. If the width is 0 the column will be automatically sized. Margin-left and right can only be specified in pixels.

[HorizontalGroup]
public int A;

[HideLabel, LabelWidth (150)]
[HorizontalGroup(150)]
public LayerMask B;

// LabelWidth can be helpfull when dealing with HorizontalGroups.
[HorizontalGroup("Group 1", LabelWidth = 20)]
public int C;

[HorizontalGroup("Group 1")]
public int D;

[HorizontalGroup("Group 1")]
public int E;

// Having multiple properties in a column can be achived using multiple groups. Checkout the "Combining Group Attributes" example.
[HorizontalGroup("Split", 0.5f, LabelWidth = 20)]
[BoxGroup("Split/Left")]
public int L;

[BoxGroup("Split/Right")]
public int M;

[BoxGroup("Split/Left")]
public int N;

[BoxGroup("Split/Right")]
public int O;

// Horizontal Group also has supprot for: Title, MarginLeft, MarginRight, PaddingLeft, PaddingRight, MinWidth and MaxWidth.
[HorizontalGroup("MyButton", MarginLeft = 0.25f, MarginRight = 0.25f)]
public void SomeButton()
{
    // ...
}

[Button(ButtonSizes.Large)]
[FoldoutGroup("Buttons in Boxes")]
[HorizontalGroup("Buttons in Boxes/Horizontal")]
[BoxGroup("Buttons in Boxes/Horizontal/One")]
public void Button1() { }

[Button(ButtonSizes.Large)]
[BoxGroup("Buttons in Boxes/Horizontal/Two")]
public void Button2() { }

[Button]
[HorizontalGroup("Buttons in Boxes/Horizontal", Width = 60)]
[BoxGroup("Buttons in Boxes/Horizontal/Double")]
public void Accept() { }

[Button]
[BoxGroup("Buttons in Boxes/Horizontal/Double")]
public void Cancel() { }

[TitleGroup("Multiple Stacked Boxes")]
[HorizontalGroup("Multiple Stacked Boxes/Split")]
[VerticalGroup("Multiple Stacked Boxes/Split/Left")]
[BoxGroup("Multiple Stacked Boxes/Split/Left/Box A")]
public int BoxA;

[BoxGroup("Multiple Stacked Boxes/Split/Left/Box B")]
public int BoxB;

[VerticalGroup("Multiple Stacked Boxes/Split/Right")]
[BoxGroup("Multiple Stacked Boxes/Split/Right/Box C")]
public int BoxC, BoxD, BoxE;