Version 3.3.1.2

Odin has a dedicated attribute overview with examples

EnumToggleButtonsAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[Conditional("UNITY_EDITOR")]
public class EnumToggleButtonsAttribute : Attribute, _Attribute

Draws an enum in a horizontal button group instead of a dropdown.

Inheritance
  • System.Object
  • System.Attribute
  • EnumToggleButtonsAttribute
Example
public class MyComponent : MonoBehvaiour
{
    [EnumToggleButtons]
    public MyBitmaskEnum MyBitmaskEnum;

    [EnumToggleButtons]
    public MyEnum MyEnum;
}

[Flags]
public enum MyBitmaskEnum
{
    A = 1 << 1, // 1
    B = 1 << 2, // 2
    C = 1 << 3, // 4
    ALL = A | B | C
}

public enum MyEnum
{
    A,
    B,
    C
}
See Also
  • System.Attribute

Constructors

EnumToggleButtonsAttribute()
public EnumToggleButtonsAttribute()