Class EventBase<T>
Generic base class for events, implementing event pooling and automatic registration to the event type system.
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public abstract class EventBase<T> : EventBase where T : EventBase<T>, new()
Type Parameters
Name | Description |
---|---|
T |
Constructors
EventBase()
Declaration
protected EventBase()
Properties
eventTypeId
Retrieves the type ID for this event instance.
Declaration
public override long eventTypeId { get; }
Property Value
Type | Description |
---|---|
Int64 |
Overrides
Methods
Dispose()
Implementation of IDispose.
Declaration
public override sealed void Dispose()
Overrides
Remarks
If the event was instantiated from an event pool, the event is released when Dispose is called.
GetPooled()
Gets an event from the event pool. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use Dispose()
to release them.
Declaration
public static T GetPooled()
Returns
Type | Description |
---|---|
T | An initialized event. |
Init()
Resets all event members to their initial values.
Declaration
protected override void Init()
Overrides
TypeId()
Retrieves the type ID for this event instance.
Declaration
public static long TypeId()
Returns
Type | Description |
---|---|
Int64 | The type ID. |