Foldout Group Attribute

FoldoutGroup is used on any property, and organizes properties into a foldout. Use this to organize properties, and to allow the user to hide properties that are not relevant for them at the moment.

[FoldoutGroup("Group 1")]
public int A;

[FoldoutGroup("Group 1")]
public int B;

[FoldoutGroup("Group 1")]
public int C;

[FoldoutGroup("Collapsed group", expanded: false)]
public int D;

[FoldoutGroup("Collapsed group")]
public int E;

[FoldoutGroup("$GroupTitle", expanded: true)]
public int One;

[FoldoutGroup("$GroupTitle")]
public int Two;

public string GroupTitle = "Dynamic group title";

[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() { }