ButtonGroupAttribute

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 tiddy horizontal group.

namespace Sirenix.OdinInspector
{
[AttributeUsageAttribute((AttributeTargets)64, AllowMultiple = True, Inherited = True)]
public class ButtonGroupAttribute : PropertyGroupAttribute
}

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 1.0.4.1

See Also

Constructors

Definition Description
ButtonGroupAttribute(string, int) Organizes the button into the specified button group.

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