Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Q

Convenience overload, shorthand for Query<T>().Build().First().
Read time 2 minutesLast updated 8 days ago

Definition

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.

name

If specified, will select elements with this name.

classes

If provided, it selects elements with all the specified classes (case sensitive, to be distinguished from Type).

Returns

Type

Description

TThe 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.

name

If specified, will select elements with this name.

classes

If provided, it selects elements with all the specified classes (case sensitive, to be distinguished from Type).

Returns

Type

Description

VisualElementThe 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.

name

If specified, will select elements with this name.

className

If provided, it selects elements with the specified class (case sensitive, to be distinguished from Type).

Returns

Type

Description

TThe 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.

name

If specified, will select elements with this name.

className

If provided, it selects elements with the specified class (case sensitive, to be distinguished from Type).

Returns

Type

Description

VisualElementThe first element matching all the criteria, or null if none was found.