Class UxmlEnumAttributeDescription<T>
Describes a XML attribute representing an enum
as a string
.
Inheritance
UxmlEnumAttributeDescription<T>
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public class UxmlEnumAttributeDescription<T> : TypedUxmlAttributeDescription<T> where T : struct, IConvertible
Type Parameters
Name | Description |
---|---|
T |
Constructors
UxmlEnumAttributeDescription()
Constructor.
Declaration
public UxmlEnumAttributeDescription()
Properties
defaultValueAsString
The default value for the attribute, as a string.
Declaration
public override string defaultValueAsString { get; }
Property Value
Type | Description |
---|---|
String |
Overrides
UnityEngine.UIElements.TypedUxmlAttributeDescription<T>.defaultValueAsString
Methods
GetValueFromBag(IUxmlAttributes, CreationContext)
Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return
Declaration
public override T GetValueFromBag(IUxmlAttributes bag, CreationContext cc)
Parameters
Type | Name | Description |
---|---|---|
IUxmlAttributes | bag | The bag of attributes. |
CreationContext | cc | The context in which the values are retrieved. |
Returns
Type | Description |
---|---|
T | The value of the attribute. |
Overrides
UnityEngine.UIElements.TypedUxmlAttributeDescription<T>.GetValueFromBag(UnityEngine.UIElements.IUxmlAttributes, UnityEngine.UIElements.CreationContext)
TryGetValueFromBag(IUxmlAttributes, CreationContext, ref T)
Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false.
Declaration
public bool TryGetValueFromBag(IUxmlAttributes bag, CreationContext cc, ref T value)
Parameters
Type | Name | Description |
---|---|---|
IUxmlAttributes | bag | The bag of attributes. |
CreationContext | cc | The context in which the values are retrieved. |
T | value | The value of the attribute. |
Returns
Type | Description |
---|---|
Boolean | True if the value could be retrieved, false otherwise. |