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
- Type: Struct
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
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 |
|---|---|
| Register | Adds all group event handlers to the given element. |
| Unregister | Removes all group event handlers from the given element. |