Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


EventBase

The base class for all UIElements events. The class implements IDisposable to ensure proper release of the event from the pool and of any unmanaged resources, when necessary.
Read time 2 minutesLast updated 10 days ago

Definition

public abstract class EventBase : IDisposable

Constructors

Constructor

Description

EventBase()Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances.

Properties

Property

Description

bubblesReturns whether this event type bubbles up in the event propagation path.
currentTargetThe current target of the event. This is the VisualElement, in the propagation path, for which event handlers are currently being executed.
dispatchIndicates whether the event is being dispatched to a visual element. An event cannot be redispatched while it being dispatched. If you need to recursively dispatch an event, it is recommended that you use a copy of the event.
eventTypeIdRetrieves the type ID for this event instance.
imguiEventThe IMGUIEvent at the source of this event. The source can be null since not all events are generated by IMGUI.
isImmediatePropagationStoppedIndicates whether StopImmediatePropagation() was called for this event.
isPropagationStoppedWhether StopPropagation() was called for this event.
originalMousePositionThe original mouse position of the IMGUI event, before it is transformed to the current target local coordinates.
pooledWhether the event is allocated from a pool of events.
propagationPhaseThe current propagation phase for this event.
targetThe target visual element that received this event. Unlike currentTarget, this target does not change when the event is sent to other elements along the propagation path.
timestampThe time when the event was created, in milliseconds.
tricklesDownReturns whether this event is sent down the event propagation path during the TrickleDown phase.

Methods

Method

Description

DisposeImplementation of IDisposable.
InitResets all event members to their initial values.
PostDispatchAllows subclasses to perform custom logic after the event has been dispatched.
PreDispatchAllows subclasses to perform custom logic before the event is dispatched.
StopImmediatePropagationImmediately stops the propagation of the event. The event isn't sent to other elements along the propagation path. This method prevents other event handlers from executing on the current target.
StopPropagationStops propagating this event. The event is not sent to other elements along the propagation path. This method does not prevent other event handlers from executing on the current target. If this method is called during the TrickleDown propagation phase, it will prevent default actions to be processed, such as an element getting focused as a result of a PointerDownEvent.

Static Methods

Method

Description

RegisterEventTypeRegisters an event class to the event type system.