ドキュメント

Unity Engine

Unity Engine

GetComponent<T>()

Returns a reference to the attached component of type T.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

public ref T GetComponent<T>() where T : struct, IVisualElementComponent

Returns

Type

Description

TA reference to the live component data.

Remarks

The reference points at the component's live storage: assigning to its fields updates the element directly, with no need to write the value back. The reference stays valid until the component is removed.