Q
Convenience overload, shorthand for Query<T>().Build().First().
Read time 2 minutesLast updated 8 days ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
Q<T>(VisualElement, string, string[])
Convenience overload, shorthand for
Query<T>().Build().First().public static T Q<T>(this VisualElement e, string name = null, params string[] classes) where T : VisualElement
Parameters
Root VisualElement on which the selector will be applied.
If specified, will select elements with this name.
If provided, it selects elements with all the specified classes (case sensitive, to be distinguished from Type).
Returns
Type | Description |
|---|---|
| T | The first element matching all the criteria, or null if none was found. |
Q(VisualElement, string, string[])
Convenience overload, shorthand for
Query<T>().Build().First().public static VisualElement Q(this VisualElement e, string name = null, params string[] classes)
Parameters
Root VisualElement on which the selector will be applied.
If specified, will select elements with this name.
If provided, it selects elements with all the specified classes (case sensitive, to be distinguished from Type).
Returns
Type | Description |
|---|---|
| VisualElement | The first element matching all the criteria, or null if none was found. |
Q<T>(VisualElement, string, string)
Convenience overload, shorthand for
Query<T>().Build().First().public static T Q<T>(this VisualElement e, string name = null, string className = null) where T : VisualElement
Parameters
Root VisualElement on which the selector will be applied.
If specified, will select elements with this name.
If provided, it selects elements with the specified class (case sensitive, to be distinguished from Type).
Returns
Type | Description |
|---|---|
| T | The first element matching all the criteria, or null if none was found. |
Q(VisualElement, string, string)
Convenience overload, shorthand for
Query<T>().Build().First().public static VisualElement Q(this VisualElement e, string name = null, string className = null)
Parameters
Root VisualElement on which the selector will be applied.
If specified, will select elements with this name.
If provided, it selects elements with the specified class (case sensitive, to be distinguished from Type).
Returns
Type | Description |
|---|---|
| VisualElement | The first element matching all the criteria, or null if none was found. |