GetComponent<T>()
Returns a reference to the attached component of type T.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
public ref T GetComponent<T>() where T : struct, IVisualElementComponent
Returns
Type | Description |
|---|---|
| T | A 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.