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.
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()
{
// ..
}
}
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()
{ }
}
public ButtonGroupAttribute(string group = "_DefaultGroup", float order = 0F)
System.String | group | The group to organize the button into. |
System.Single | order | The order of the group in the inspector.. |
public int ButtonHeight
public int ButtonAlignment { get; set; }
public bool HasDefinedButtonAlignment { get; }
public bool HasDefinedButtonIconAlignment { get; }
public bool HasDefinedStretch { get; }
public IconAlignment IconAlignment { get; set; }
public bool Stretch { get; set; }