[EnumToggleButtons]

Displays an enum field as a row of toggle buttons.

Support Types

Type
Description

Enum

Any Enum type

Parameters

Parameter Name
Arguments
Description

HideValues

string

Hide specific enum values. Return type of member must be IEnumerable<Enum>.

AllowPaths

bool

Allow using a path as a name?

ShowPathAlways

bool

If you have allowed the use of paths, set true if you want the path to the value to be displayed in the selected value.

FlagSeparator

string

Custom separator symbol for enum flags.

UnityOrder

bool

Unity representation of enum shortcuts position.

ShortcutBits

bool

Automatically add default shortcut bits to select/deselect all flags.

ShortcutShortNames

bool

Use short names for shortcut bits when ShortcutBits is true. If enabled, uses "None" instead of "Nothing" and "All" instead of "Everything".

UseAsFlags

bool

Use this enum field as flags.

ShortNaming

bool

Use the abbreviated name for the selected flags. Keep in mind this option work only with enums which have [System.Flags] attribute.

Examples

using UnityEngine;
using RenownedGames.Apex;

public enum Alignment
{
    Left,
    Center,
    Right
}

public class EnumToggleButtonsExample : MonoBehaviour
{
    [EnumToggleButtons]
    public Alignment alignment;
}

Last updated