Room list that works for NGUI

foreach(RoomInfo game in PhotonNetwork.GetRoomList()){
GUILayout.Label(game.name + " " + game.playerCount + "/" + game.maxPlayers);
}

How Can I make it work for NGUI?

I've been trying for 2h now... :?

Comments

  • This is more of a question for the NGUI forums.
    "Given a dynamic list of strings how do I create corresponding list of buttons"

    I would recommend:
    - create a variable RoomList
    - create a variable prevRoomList

    The for every room list update:
    1) RoomList = PhotonNetwork.GetRoomList()
    3) Create buttons that are in RoomList but aren't in prevRoomList.
    3) Destroy buttons that are in the prevRoomList but aren't in RoomList .
    4) prevRoomList = RoomList

    As far as arranging the buttons goes, I remember NGUI offers a grid script that will organize child transforms as well as a scroll-able panel.