PlayFlowLobbyManagerV2 uses a system of UnityEvents to communicate state changes and important occurrences to your game. By subscribing to these events, you can create a responsive UI and trigger game logic at the right moments.
All events are accessible through the PlayFlowLobbyManagerV2.Instance.Events property, which is an instance of PlayFlowEvents.
Subscribing to Events
You subscribe to events using the standardAddListener method. It’s best practice to do this after the manager has been initialized.
Event Reference
Here is a complete list of events available onPlayFlowEvents.
Lobby Events
Fired when a lobby is successfully created by the local player. The event passes the created
Lobby object.
Argument: LobbyFired when the local player successfully joins a lobby.
Argument:
LobbyFired whenever the
Lobby data changes. This can be due to players joining/leaving, player state changes, or host actions.
Argument: LobbyFired after the local player successfully leaves a lobby.
Argument:
voidMatch Events
Fired for all players in a lobby when the host starts the match.
Argument:
LobbyFired when the match is running and connection info is available.
Argument:
ConnectionInfoFired for all players when the host ends the match.
Argument:
LobbyPlayer Events
Fired for all players in a lobby when a new player joins. The
PlayerAction contains the ID of the player who joined.
Argument: PlayerActionFired for all players in a lobby when another player leaves. The
PlayerAction contains the ID of the player who left.
Argument: PlayerActionSystem Events
Fired when the client successfully connects to the PlayFlow service.
Argument:
voidFired when the client disconnects from the PlayFlow service.
Argument:
voidFired when any error occurs within the SDK. Provides a string message describing the error.
Argument:
string