title: How can I list rooms in Unity? (PUN2)
body: <p>I need to list the romos there are in my lobby scene. For now, this is the code I've used but I don't know why it isnt working. Is this the correct way?</p>
  
  <pre><code>public override void OnRoomListUpdate(List&lt;RoomInfo&gt; roomList)
       {
           print(roomList.Count + " Rooms");
           base.OnRoomListUpdate(roomList);
           foreach (var Item in roomList)
           {
               RoomName = Item.Name;
               PlayerAmount = Item.PlayerCount;
               MaxPlayers = Item.MaxPlayers;
               PhotonNetwork.Instantiate("RoomPrefab", transform.position, transform.rotation);
               RoomPrefab.transform.Find("RoomName").GetComponent&lt;Text&gt;().text = RoomName;
               RoomPrefab.transform.Find("PlayerInt").GetComponent&lt;Text&gt;().text = PlayerAmount.ToString();
               if(MaxPlayers == 4)
               {
                   GameObject.Find("IPlayerA").GetComponent&lt;Image&gt;().sprite = Four;
               }
               else if (MaxPlayers == 2)
               {
                   GameObject.Find("IPlayerA").GetComponent&lt;Image&gt;().sprite = Two;
               }
               else if (MaxPlayers == 3)
               {
                   GameObject.Find("IPlayerA").GetComponent&lt;Image&gt;().sprite = Three;
               }
               RoomPrefab.transform.SetParent(ScrollView.transform, false);
           }
       }
  </code></pre>
  
  <p>I need to specify that I'm using Photon's PUN2, so GetRoomList won't work.</p>