Version 2.1.0.0

Odin has a dedicated attribute overview with examples

BoxGroupAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class BoxGroupAttribute : PropertyGroupAttribute, _Attribute

BoxGroup is used on any property and organizes the property in a boxed group.

Use this to cleanly organize relevant values together in the inspector.

Inheritance
Example

The following example shows how BoxGroup is used to organize properties together into a box.

public class BoxGroupExamples : MonoBehaviour
{
    // Box with a centered title.
    [BoxGroup("Centered Title", centerLabel: true)]
    public int A;

    [BoxGroup("Centered Title", centerLabel: true)]
    public int B;

    [BoxGroup("Centered Title", centerLabel: true)]
    public int C;

    // Box with a title.
    [BoxGroup("Left Oriented Title")]
    public int D;

    [BoxGroup("Left Oriented Title")]
    public int E;

    // Box with a title recieved from a field.
    [BoxGroup("$DynamicTitle1"), LabelText("Dynamic Title")]
    public string DynamicTitle1 = "Dynamic box title";

    [BoxGroup("$DynamicTitle1")]
    public int F;

    // Box with a title recieved from a property.
    [BoxGroup("$DynamicTitle2")]
    public int G;

    [BoxGroup("$DynamicTitle2")]
    public int H;

    // Box without a title.
    [InfoBox("You can also hide the label of a box group.")]
    [BoxGroup("NoTitle", false)]
    public int I;

    [BoxGroup("NoTitle")]
    public int J;

    [BoxGroup("NoTitle")]
    public int K;

#if UNITY_EDITOR
    public string DynamicTitle2
    {
        get { return UnityEditor.PlayerSettings.productName; }
    }
#endif

    [BoxGroup("Boxed Struct"), HideLabel]
    public SomeStruct BoxedStruct;

    public SomeStruct DefaultStruct;

    [Serializable]
    public struct SomeStruct
    {
        public int One;
        public int Two;
        public int Three;
    }
}

Constructors

BoxGroupAttribute()
Initializes a new instance of the BoxGroupAttribute class. Use the other constructor overloads in order to show a header-label on the box group.
public BoxGroupAttribute()
BoxGroupAttribute(String, Boolean, Boolean, Int32)
Adds the property to the specified box group.
public BoxGroupAttribute(string group, bool showLabel = true, bool centerLabel = false, int order = 0)
Parameters
System.String group

The box group.

System.Boolean showLabel

If true a label will be drawn for the group.

System.Boolean centerLabel

If set to true the header label will be centered.

System.Int32 order

The order of the group in the inspector.

Fields

CenterLabel
If true the header label will be places in the center of the group header. Otherwise it will be in left side.
public bool CenterLabel
ShowLabel
If true a label for the group will be drawn on top.
public bool ShowLabel

Methods

CombineValuesWith(PropertyGroupAttribute)
Combines the box group with another group.
protected override void CombineValuesWith(PropertyGroupAttribute other)
Parameters
PropertyGroupAttribute other

The other group.

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.