Class EnumFlagsField
Makes a dropdown for switching between enum flag values that are marked with the Flags attribute.
Inherited Members
Namespace: UnityEditor.UIElements
Syntax
public class EnumFlagsField : BaseMaskField<Enum>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IBindable, INotifyValueChanged<Enum>, IMixedValueSupport
Constructors
EnumFlagsField()
Constructs an EnumFlagsField with a default value, and initializes its underlying type.
Declaration
public EnumFlagsField()
EnumFlagsField(Enum)
Constructs an EnumFlagsField with a default value, and initializes its underlying type.
Declaration
public EnumFlagsField(Enum defaultValue)
Parameters
Type | Name | Description |
---|---|---|
Enum | defaultValue | Initial value. This also detects the Enum type. |
EnumFlagsField(Enum, Boolean)
Constructs an EnumFlagsField with a default value, and initializes its underlying type.
Declaration
public EnumFlagsField(Enum defaultValue, bool includeObsoleteValues)
Parameters
Type | Name | Description |
---|---|---|
Enum | defaultValue | Initial value. This also detects the Enum type. |
Boolean | includeObsoleteValues |
EnumFlagsField(String)
Constructs an EnumFlagsField with a default value, and initializes its underlying type.
Declaration
public EnumFlagsField(string label)
Parameters
Type | Name | Description |
---|---|---|
String | label |
EnumFlagsField(String, Enum)
Constructs an EnumFlagsField with a default value, and initializes its underlying type.
Declaration
public EnumFlagsField(string label, Enum defaultValue)
Parameters
Type | Name | Description |
---|---|---|
String | label | |
Enum | defaultValue | Initial value. This also detects the Enum type. |
EnumFlagsField(String, Enum, Boolean)
Constructs an EnumFlagsField with a default value, and initializes its underlying type.
Declaration
public EnumFlagsField(string label, Enum defaultValue, bool includeObsoleteValues)
Parameters
Type | Name | Description |
---|---|---|
String | label | |
Enum | defaultValue | Initial value. This also detects the Enum type. |
Boolean | includeObsoleteValues |
Fields
inputUssClassName
USS class name for input elements of this type.
Declaration
public static readonly string inputUssClassName
Field Value
Type | Description |
---|---|
String |
labelUssClassName
USS class name for labels of this type.
Declaration
public static readonly string labelUssClassName
Field Value
Type | Description |
---|---|
String |
ussClassName
USS class name for elements of this type.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
String |
Methods
Init(Enum, Boolean)
Initializes the EnumFlagsField with a default value, and initializes its underlying type.
Declaration
public void Init(Enum defaultValue, bool includeObsoleteValues = false)
Parameters
Type | Name | Description |
---|---|---|
Enum | defaultValue | The typed enum value. |
Boolean | includeObsoleteValues | Set to true to display obsolete values as choices. |