Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RegisterEventHandler

Registers a handler for a specific event type. The handler is called whenever a message of the specified type is sent. Messages are sent using EventService.Emit or EventService.Request.
Read time 1 minuteLast updated 12 days ago

Definition

RegisterEventHandler(string, Action<string, Object[]>)

Registers a handler for a specific event type. The handler is called whenever a message of the specified type is sent. Messages are sent using EventService.Emit or EventService.Request.
public static Action RegisterEventHandler(string eventType, Action<string, object[]> handler)

Parameters

eventType

The event type name.

The handler.

Returns

Type

Description

ActionAn action that, when invoked, unregisters the handler (see Off).

RegisterEventHandler(string, Func<string, Object[], Object>)

Registers a handler for a specific event type. The handler is called whenever a message of the specified type is sent. Messages are sent using EventService.Emit or EventService.Request.
public static Action RegisterEventHandler(string eventType, Func<string, object[], object> handler)

Parameters

eventType

The event type name.

Returns

Type

Description

ActionAn action that, when invoked, unregisters the handler (see Off).