OfType
Selects all elements of the specified Type (eg: Label, Button, ScrollView, etc).
Read time 2 minutesLast updated 11 days ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
OfType<T>(string, string[])
Selects all elements of the specified Type (eg: Label, Button, ScrollView, etc).
public UQueryBuilder<T2> OfType<T2>(string name = null, params string[] classes) where T2 : VisualElement
Parameters
Returns
Type | Description |
|---|---|
| UQueryBuilder<T> | QueryBuilder configured with the associated selection rules. |
OfType<T>(string, UniqueStyleString[])
Selects all elements of the specified Type (eg: Label, Button, ScrollView, etc).
public UQueryBuilder<T2> OfType<T2>(string name = null, params UniqueStyleString[] classes) where T2 : VisualElement
Parameters
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 |
|---|---|
| UQueryBuilder<T> | QueryBuilder configured with the associated selection rules. |
OfType<T>(string, string)
Selects all elements of the specified Type (eg: Label, Button, ScrollView, etc).
public UQueryBuilder<T2> OfType<T2>(string name = null, string className = null) where T2 : VisualElement
Parameters
Returns
Type | Description |
|---|---|
| UQueryBuilder<T> | QueryBuilder configured with the associated selection rules. |
OfType<T>(UniqueStyleString)
Selects all elements of the specified Type (eg: Label, Button, ScrollView, etc).
public UQueryBuilder<T2> OfType<T2>(UniqueStyleString className) where T2 : VisualElement
Parameters
If specified, will select elements with the given class (not to be confused with Type).
Returns
Type | Description |
|---|---|
| UQueryBuilder<T> | QueryBuilder configured with the associated selection rules. |
OfType<T>(string, UniqueStyleString)
Selects all elements of the specified Type (eg: Label, Button, ScrollView, etc).
public UQueryBuilder<T2> OfType<T2>(string name, UniqueStyleString className) where T2 : VisualElement
Parameters
If specified, will select elements with this name.
If specified, will select elements with the given class (not to be confused with Type).
Returns
Type | Description |
|---|---|
| UQueryBuilder<T> | QueryBuilder configured with the associated selection rules. |