Hide If Group Attribute

HideIfGroup allows for showing or hiding a group of properties based on a condition. The attribute is a group attribute and can therefore be combined with other group attributes, and even be used to show or hide entire groups.

public bool Toggle = true;

[HideIfGroup("Toggle")]
[BoxGroup("Toggle/Shown Box")]
public int A, B;

[BoxGroup("Box")]
public InfoMessageType EnumField = InfoMessageType.Info;

[BoxGroup("Box")]
[HideIfGroup("Box/Toggle")]
public Vector3 X, Y;

// Like the regular If-attributes, HideIfGroup also supports specifying values.
// You can also chain multiple HideIfGroup attributes together for more complex behaviour.
[HideIfGroup("Box/Toggle/EnumField", Value = InfoMessageType.Info)]
[BoxGroup("Box/Toggle/EnumField/Border", ShowLabel = false)]
public string Name;

[BoxGroup("Box/Toggle/EnumField/Border")]
public Vector3 Vector;

// HideIfGroup will by default use the name of the group,
// but you can also use the MemberName property to override this.
[HideIfGroup("RectGroup", Condition = "Toggle")]
public Rect Rect;