public void GetRoomLIst() { RoomInfo[] roomInfos = PhotonNetwork.GetRoomList(); //Debug.Log(roomInfos.Length); for (int i = 0; i < roomInfos.Length; i++) { if (m_roomItemPrefab == null) { return; } if (m_roomListParent == null) { return; } GameObject roomItemgo = Instantiate(m_roomItemPrefab, m_roomListParent.transform); roomItemgo.name = m_roomItemPrefab.name + i + 1; RoomListItem item = roomItemgo.GetComponent <RoomListItem>(); if (item == null) { Destroy(roomItemgo); return; } item.InitRoomListItem(roomInfos[i].Name, roomInfos[i].PlayerCount, roomInfos[i].MaxPlayers); } }