Tying together the multiplayer lobby
Create a copy of your CreateCanvas and disable the original in the Inspector to hide it for now. Remove all of the buttons and images from the canvas, except the START button, so that you're left with a mostly empty menu, as shown in the following screenshot:
Rename the START button to BACK
and change its text to BACK to match. Create a new Button object within the JoinCanvas and set Width to 350
, Height to 30
, and Scale to 0.01
. Give it the same styling and font as the other buttons, but remove the text for now. Duplicate the button three times and arrange the four in a list, naming them Match1
, Match2
, Match3
, and Match4
in Inspector. They should look something like the following on the canvas:
These four buttons will represent up to four matches returned by the matchmaking system. They'll display the level name and the current number of players in the match using the button's text field, which the NetworkGameManager
script will update.
We'll need...