Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


EventCallbackGroup<TElement>

An object that can be registered on elements of a specific type to rapidly register multiple event callbacks.
Read time 1 minuteLast updated 6 days ago

Definition

public readonly struct EventCallbackGroup<TElement> where TElement : VisualElement

Remarks

The same callback group can be registered on multiple different elements, resulting in effective memory sharing. Note that individual callbacks that are also part of a registered group should not be unregistered separately from the rest of their group.
Additional Resources: EventCallbackDefinition<TElement>

Constructors

Constructor

Description

EventCallbackGroup`1(System.ReadOnlySpan{UnityEngine.UIElements.EventCallbackDefinition{`0}})Creates a callback group allowing the provided callbacks to be registered and unregistered all at once on any element of a compatible type.
EventCallbackGroup`1(UnityEngine.UIElements.EventCallbackDefinition{`0}[])Creates a callback group allowing the provided callbacks to be registered and unregistered all at once on any element of a compatible type.

Methods

Method

Description

RegisterAdds all group event handlers to the given element.
UnregisterRemoves all group event handlers from the given element.