Class UIElementsUtility
A utility class for performing operations related to UIElements.
Namespace: Unity.AnimeToolbox
Syntax
public static class UIElementsUtility
Methods
AddElement<T>(VisualElement, String)
Add a VisualElement
Declaration
public static T AddElement<T>(VisualElement parent, string className = null)
where T : VisualElement, new()
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | parent | The parent that will contain the new VisualElement |
| String | className | The class of the VisualElement. Will be ignored if set to null |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | The newly created VisualElement |
AddField<F, V>(VisualElement, GUIContent, V)
Add a UIElements field
Declaration
public static F AddField<F, V>(VisualElement parent, GUIContent content, V initialValue)
where F : BaseField<V>, INotifyValueChanged<V>, new()
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | parent | The parent that will contain the new field |
| GUIContent | content | The tooltip and label of the field |
| V | initialValue | The initial value of the field |
Returns
| Type | Description |
|---|---|
| F |
Type Parameters
| Name | Description |
|---|---|
| F | The type of the field |
| V | The type of the field's value |