Class OptionalEnumConverter<T>
Base UXML attribute converter for OptionalEnum<T> values.
Inherited Members
Namespace: Unity.AppUI.Editor
Assembly: Unity.AppUI.Editor.dll
Syntax
public abstract class OptionalEnumConverter<T> : UxmlAttributeConverter<OptionalEnum<T>> where T : struct, Enum
Type Parameters
| Name | Description |
|---|---|
| T | The enum type wrapped by the OptionalEnum<T>. |
Remarks
An empty or unrecognized attribute value is converted to none.
Methods
FromString(string)
Converts a UXML attribute value into an OptionalEnum<T>.
Declaration
public override OptionalEnum<T> FromString(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The attribute value to convert. |
Returns
| Type | Description |
|---|---|
| OptionalEnum<T> | The converted value, or none if it is empty or not a member of |
Overrides
ToString(OptionalEnum<T>)
Converts an OptionalEnum<T> into its UXML attribute representation.
Declaration
public override string ToString(OptionalEnum<T> value)
Parameters
| Type | Name | Description |
|---|---|---|
| OptionalEnum<T> | value | The value to convert. |
Returns
| Type | Description |
|---|---|
| string | The name of the enum member, or an empty string if no value is set. |
Overrides
UnityEditor.UIElements.UxmlAttributeConverter<Unity.AppUI.Core.OptionalEnum<T>>.ToString(Unity.AppUI.Core.OptionalEnum<T>)