public override void OnPhotonPlayerDisconnected(PhotonPlayer disconnectedPlayer)
        {
            base.OnPhotonPlayerDisconnected(disconnectedPlayer);

            TMP_Dropdown.OptionData option = PhotonPlayerDropdownOptionMap[disconnectedPlayer];
            PhotonPlayerDropdownOptionMap.Remove(disconnectedPlayer);
            DropdownPlayersList.options.Remove(option);

            if (SelectedPlayer.ID == disconnectedPlayer.ID)
            {
                ListViewOtherPlayersWorkers.RemoveAllControls();
                SelectedPlayer = null;

                if (0 != DropdownPlayersList.options.Count)
                {
                    DropdownPlayersList.SetValueWithoutNotify(0);
                    OnDropdownPlayersListValueChanged(DropdownPlayersList.value);
                }
            }
        }
Exemplo n.º 2
0
        private void RefreshRoomList()
        {
            if (ListViewRooms.Controls.Count > 0 && null == ListViewElementPool)
            {
                ListViewElementPool = new Queue <ListViewElementRoom>();
            }

            foreach (GameObject obj in ListViewRooms.Controls)
            {
                ListViewElementRoom elem = obj.GetComponent <ListViewElementRoom>();
                elem.gameObject.SetActive(false);
                ListViewElementPool.Enqueue(elem);
            }

            ListViewRooms.RemoveAllControls(false);
            RoomButtonSelector.RemoveAllButtons();
            AddLobbbyRoomsButtons();
            ButtonJoinRoom.interactable = false;
            SetRoomListText();
        }