public void RefreshRoomList() { // Limpia la lista de salas if (this.actualRoomSlots.Count > 0) { foreach (GameObject slot in this.actualRoomSlots) { Destroy(slot); } this.actualRoomSlots.Clear(); } RoomInfo[] rooms = PhotonNetwork.GetRoomList(); int j = 100; foreach (RoomInfo room in rooms) { GameObject rsgo = Instantiate(this.roomSlotPrb) as GameObject; RectTransform rst = rsgo.GetComponent <RectTransform>(); RoomSlotData rsd = rsgo.GetComponent <RoomSlotData>(); rst.parent = this.roomListPanel; rst.anchoredPosition = new Vector2(0, j); rst.localScale = Vector3.one; rsd.roomNameLabel.text = room.name; rsd.playersLabel.text = room.playerCount + "/" + room.maxPlayers; rsd.connectButton.onClick.AddListener(() => NetManage.current.JoinRoom(room.name)); j -= 40; } }
public void Load(RoomSlotData data) { if (UnigeID != data.uniqueID) { print("Warning!!! Room data Object does not fit ID " + UnigeID); } this.Item = data.item; }
public InteriorData(InteriorNodeBehavior node) { rooms = new RoomSlotData[node.roomSlotList.Count]; }