Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


EventCallbackGroup

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

Definition

public readonly struct EventCallbackGroup

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

Constructors

Constructor

Description

EventCallbackGroup(System.ReadOnlySpan{UnityEngine.UIElements.EventCallbackDefinition})Creates a callback group allowing the provided callbacks to be registered and unregistered all at once on any VisualElement.
EventCallbackGroup(UnityEngine.UIElements.EventCallbackDefinition[])Creates a callback group allowing the provided callbacks to be registered and unregistered all at once on any VisualElement.

Methods

Method

Description

IsRegisteredReturns whether this group is registered for the given element.
RegisterAdds all group event handlers to the given element.
UnregisterRemoves all group event handlers from the given element.