Table of Contents

Class EventSystem

Namespace
Ceres.Events
Assembly
Ceres.dll
public class EventSystem : MonoEventCoordinator, IEventCoordinator
Inheritance
EventSystem
Implements
Inherited Members

Constructors

EventSystem()

public EventSystem()

Properties

EventHandler

Get event system CallbackEventHandler

public static CallbackEventHandler EventHandler { get; }

Property Value

CallbackEventHandler

Instance

public static EventSystem Instance { get; }

Property Value

EventSystem

Methods

Awake()

protected override void Awake()

GetCallbackEventHandler()

Get coordinator's default event handler

public override sealed CallbackEventHandler GetCallbackEventHandler()

Returns

CallbackEventHandler

RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)

Adds an event handler to the instance. If the event handler has already been registered for the same phase (either TrickleDown or BubbleUp) then this method has no effect.

public static void RegisterCallback<TEventType>(EventCallback<TEventType> callback, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase<TEventType>, new()

Parameters

callback EventCallback<TEventType>

The event handler to add.

useTrickleDown TrickleDown

Type Parameters

TEventType

SendEvent(EventBase, DispatchMode, MonoDispatchType)

Sends an event to the event handler.

public static void SendEvent(EventBase eventBase, DispatchMode dispatchMode = DispatchMode.Default, MonoDispatchType monoDispatchType = MonoDispatchType.Update)

Parameters

eventBase EventBase

The event to send.

dispatchMode DispatchMode

The event dispatch mode.

monoDispatchType MonoDispatchType

Dispatch event on which MonoBehaviour tick frame。

UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)

Remove callback from the instance.

public static void UnregisterCallback<TEventType>(EventCallback<TEventType> callback, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase<TEventType>, new()

Parameters

callback EventCallback<TEventType>

The callback to remove. If this callback was never registered, nothing happens.

useTrickleDown TrickleDown

Set this parameter to true to remove the callback from the TrickleDown phase. Set this parameter false to remove the callback from the BubbleUp phase.

Type Parameters

TEventType