Version 2.1.0.0

Odin has a dedicated attribute overview with examples

EnumToggleButtonsAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
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()
Initializes a new instance of the EnumToggleButtonsAttribute class.
public EnumToggleButtonsAttribute()