Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Lobby : Photon.MonoBehaviour {
- void Start() {
- PhotonNetwork.autoJoinLobby = true;
- PhotonNetwork.ConnectToRegion(CloudRegionCode.kr, "v0.0.1");
- }
- public virtual void OnJoinedLobby() {
- print("JOINED LOBBY. GET SOME ROOM LIST.");
- }
- public virtual void OnReceivedRoomListUpdate() {
- print("RECEIVED ROOMS");
- print("Is in lobby? " + PhotonNetwork.insideLobby);
- PrintRooms();
- }
- void PrintRooms() {
- RoomInfo[] rooms = PhotonNetwork.GetRoomList();
- print(rooms);
- foreach(RoomInfo roomInfo in rooms) {
- print("Name: " + roomInfo.Name + "nPlayers: " + roomInfo.PlayerCount + " / " + roomInfo.MaxPlayers);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement