- Home /
Setting up a GUI System for room selection , Multiplayer (Photon/Unet)
I am trying to make a GUI system for Multiplayer Room Selection for some multiplayer card game I am trying to develop. I am using photon - But I can't any Documentation / any online reference about that . Can Anyone help and guide me ? Pointing towards any tutorial or any documentation will be a massive help . Photon tutorials are preferable , but Unet Tutorials are also welcome... .
Answer by ChristianSimon · Oct 12, 2017 at 08:23 AM
Hi,
in PUN you can implement the OnReceivedRoomListUpdate()
callback. This notifies the client that the local room list has been updated. From this callback you can iterate through the room list to by using PhotonNetwork.GetRoomList()
to see all available rooms. This looks like the following:
foreach (RoomInfo info in PhotonNetwork.GetRoomList())
{
// Do something
}
By accessing the info you have information about the room name, player count, max players and custom properties which you can display on your UI. The properties are important for filtering rooms, e.g. by map. To make them available to the lobby I would recommend you taking a look at the 'Not So Random Matchmaking' section of the Matchmaking guide. To display a room, you can for example instantiate an UI prefab for each available room info which displays the most important things for your game.
Your answer
Follow this Question
Related Questions
Unity multiplayer solutions: Photon, Unity Networking - what else and in what way is good? 0 Answers
Why does Photon find a room so quick! 1 Answer
Callback for DNS entry error using Photon Networking 0 Answers
Is it possible to select one scene out of given option and make it public for others to join ? 0 Answers
Unity networking tutorial? 6 Answers