VisualElementReference<T>
Represents a strongly-typed reference to a VisualElement in a PanelRenderer.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: VisualElementReference
- Implements: IEquatable<VisualElementReference>, IDisposable
public class VisualElementReference<T> : VisualElementReference, IEquatable<VisualElementReference>, IDisposable where T : VisualElement
Constructors
Constructor | Description |
|---|---|
| VisualElementReference`1() | Creates a new empty VisualElementReference. |
| VisualElementReference`1(UnityEngine.UIElements.PanelRenderer,UnityEngine.UIElements.AuthoringIdPath) | Creates a new VisualElementReference pointing to the given renderer and path. |
Methods
Method | Description |
|---|---|
| RegisterReferenceResolvedCallback | Registers a callback for when the reference is resolved from the document. When you register a callback, if the reference is already resolved, the callback is immediately invoked. |
| RegisterReferenceUnloadedCallback | Registers a callback for when the referenced object is unloaded. This occurs when the document is destroyed, such as when a live reload occurs after the VisualTreeAsset changes. At this point, all references are invalid and should be cleared. |
| UnregisterReferenceResolvedCallback | Unregisters a callback for when the reference is resolved from the document. |
| UnregisterReferenceUnloadedCallback | Unregisters a callback for when the referenced object is unloaded. |