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

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.