ドキュメント

Unity Engine

Unity Engine

TryGetReference

Retrieves the VisualElement associated with the specified authoring ID path.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

TryGetReference<T>(AuthoringIdPath, T)

Retrieves the VisualElement associated with the specified authoring ID path.
public bool TryGetReference<T>(AuthoringIdPath idPath, out T element) where T : VisualElement

Parameters

The authoring ID path to search for.

element

T
The element found at the given path. It's
null
if the element is no longer part of the hierarchy and has been destroyed.

Returns

Type

Description

bool
true
if the path was found; otherwise
false
.

TryGetReference<T>(DocumentNode, AuthoringIdPath, T)

Retrieves the VisualElement associated with the specified authoring Id path.
public bool TryGetReference<T>(VisualElementAssetReferenceTable.DocumentNode documentNode, AuthoringIdPath idPath, out T element) where T : VisualElement

Parameters

documentNode

The document node to search within. This allows searching for a path that is not based on the root.

The authoring ID path to search for.

element

T
The element found at the given path. It's
null
if the element is no longer part of the hierarchy and has been destroyed.

Returns

Type

Description

bool
true
if the path was found; otherwise
false
.