tools/purrlobby/getting-started.md
The fastest way to see PurrLobby working is to open the shipped scenes and press play. Once that runs, point it at your own game scene.
Run the sample
- Open
Assets/PurrLobby/Scenes/MenuScene.unity. - Add both
MenuSceneandGameSceneto File → Build Settings. - Press play.
You get the main menu, and from there you can create a lobby, ready up, and launch into GameScene. The scene ships wired to a working backend, so nothing needs configuring to try it.
To test with a second player, use PurrNet's multiplayer play mode or a build. Two clients in the same lobby is enough to see the ready-up, chat and start flow.
Point it at your game
- Select the LobbyManager in your menu scene and assign a
GameOrchestrator. Preset orchestrators live underAssets/PurrLobby/Providers/<backend>/Preset, so draggingOrchestrator.PurrNetorOrchestrator.Steamin fills every slot at once. - Open the orchestrator's Game Allocator asset and set its
Game Sceneto your gameplay scene. - Make sure that scene has a
NetworkManager. - Add your scene to Build Settings.
That is the whole loop. The allocator adds the transport, starts the host or client, and creates the GameSession that brings everyone back to the menu afterwards.
Auto-start flags on your NetworkManager can stay on. PurrLobby suppresses them for the duration of its own scene load, so your game scene still works as a direct-play testing environment while the lobby owns the launch.
Add the pause menu
Drop the SessionManager prefab from Assets/PurrLobby/Prefabs/Setup into your game scene. It carries an in-game ViewStack, the Escape handling, and a GameOverBroadcaster so the server can end the match for everyone.
Where to go next
| If you want to | Read |
|---|---|
| Understand the moving parts | How it works |
| Set up scenes properly | Scene setup |
| Pick or configure a backend | Providers |
| Restyle the menus | Customizing the UI |
| Handle pause, game over, reconnect | In the game scene |
| Target a backend we do not ship | Custom providers |