Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


VisualElementReference<T>

Represents a strongly-typed reference to a VisualElement in a PanelRenderer.
Read time 1 minuteLast updated 4 days ago

Definition

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

RegisterReferenceResolvedCallbackRegisters 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.
RegisterReferenceUnloadedCallbackRegisters 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.
UnregisterReferenceResolvedCallbackUnregisters a callback for when the reference is resolved from the document.
UnregisterReferenceUnloadedCallbackUnregisters a callback for when the referenced object is unloaded.

Inheritance