/ SDKs / Unity
SDKs
Calls SDKs Unity v1
Calls SDKs Unity
Calls SDKs
Unity
Version 1

Manage an event listener

Copy link

You can manage an event listener by adding or removing it from a room. When an event listener is added to a room, a user can receive events for actions taken in the room they are currently participating in.


Add an event listener

Copy link

You can add an event listener for users to receive events that occur in the room.

room.AddEventListener(new MyRoomListener());

class MyRoomListener : SbRoomEventListener { }

Remove an event listener

Copy link

You can remove the registered event listeners using the following code to stop receiving events about a room.

// Removes a specific listener.
room.RemoveEventListener(myRoomListener);

// Removes all listeners.
room.RemoveAllEventListeners();