EnumToggleButtonsAttribute

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

namespace Sirenix.OdinInspector
{
public class EnumToggleButtonsAttribute : Attribute
}

Requirements

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

See Also

  • Attribute

Constructors

Definition Description
EnumToggleButtonsAttribute() Initializes a new instance of the EnumToggleButtonsAttribute class.

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
}