Version 3.1.11.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)]
[Conditional("UNITY_EDITOR")]
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, Single)
Organizes the button into the specified button group.
public ButtonGroupAttribute(string group = "_DefaultGroup", float order = 0F)
Parameters
System.String group

The group to organize the button into.

System.Single order

The order of the group in the inspector..