Version 2.1.0.0

Odin has a dedicated attribute overview with examples

ButtonGroupAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[IncludeMyAttributes]
[ShowInInspector]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class ButtonGroupAttribute : PropertyGroupAttribute, _Attribute

ButtonGroup is used on any instance function, and adds buttons to the inspector organized into horizontal groups.

Use this to organize multiple button in a tidy horizontal group.

Inheritance
Example

The following example shows how ButtonGroup is used to organize two buttons into one group.

public class MyComponent : MonoBehaviour
{
	[ButtonGroup("MyGroup")]
	private void A()
	{
		// ..
	}

	[ButtonGroup("MyGroup")]
	private void B()
	{
		// ..
	}
}
Example

The following example shows how ButtonGroup can be used to create multiple groups of buttons.

public class MyComponent : MonoBehaviour
{
	[ButtonGroup("First")]
	private void A()
	{ }

	[ButtonGroup("First")]
	private void B()
	{ }

	[ButtonGroup("")]
	private void One()
	{ }

	[ButtonGroup("")]
	private void Two()
	{ }

	[ButtonGroup("")]
	private void Three()
	{ }
}

Constructors

ButtonGroupAttribute(String, Int32)
Organizes the button into the specified button group.
public ButtonGroupAttribute(string group = "_DefaultGroup", int order = 0)
Parameters
System.String group

The group to organize the button into.

System.Int32 order

The order of the group in the inspector..

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.