public void OnCreateRoomMapButtonClick(GameCreateRoomMapButtonItem mapButtonItem) { if (mapButtonItem.gameObject.GetComponent <UButtonGroupItem>().Selected) { UIMsgCmdData uiMapChangeInfo = new UIMsgCmdData((int)WndMsgID.WND_ID_HALLROOMINFOVIEW_GROUP_MAPBTNCLICK, mapButtonItem.m_nID, string.Empty, IntPtr.Zero, 0); UISystem.Instance.SendWndMessage(WndMsgID.WND_ID_HALLROOMINFOVIEW_GROUP_MAPBTNCLICK, uiMapChangeInfo); } }
public void InitalCustomerRoom() { RoomPassWord.text = string.Empty; // 获取自定义房间配置相关 int nIndex = 0; foreach (DictionaryEntry Info in MatchRoomCustomer.Instance.allMatchRoomCustomerTable) { bool bDefaultSelect = false; SSchemeMatchRoomCustomer sInfo = Info.Value as SSchemeMatchRoomCustomer; if (sInfo.bIsOpen == false) { continue; } if (IsOutOfMapButtonArray(nIndex)) { return; } if (nIndex == 0) { bDefaultSelect = true; } if (aMapButtonArray[nIndex] != null) { aMapButtonArray[nIndex].SetCreateRoomMapModeInfo(sInfo.nID, sInfo.MapDes, bDefaultSelect); if (bDefaultSelect) { SetCreateRoomMapDesc(sInfo.MapDetailDes, sInfo.PictrueID); UpdateComboBox(sInfo); } return; } MapItemPrefabRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "UI/Prefabs/GameHallSelectRoom/MapButton"); if (null == MapItemPrefabRes) { Debug.Log("TeamItemPrefab Is Null"); return; } GameObject MapItemObject = MapItemPrefabRes.InstanceMainRes(); if (MapItemObject == null) { return; } //添加音效 MapItemObject.AddUISoundTrigger(EventTriggerType.PointerEnter, "Common", "Button_common_slide"); MapItemObject.AddUISoundTrigger(EventTriggerType.PointerClick, "Common", "Button_common_click"); // 地图信息按钮 GameCreateRoomMapButtonItem item = MapItemObject.GetComponent <GameCreateRoomMapButtonItem>(); if (item == null) { return; } item.SetCreateRoomMapModeInfo(sInfo.nID, sInfo.MapDes, bDefaultSelect); aMapButtonArray[nIndex] = item; UButtonGroupItem itemGroup = MapItemObject.GetComponent <UButtonGroupItem>(); if (itemGroup == null || MapButtonGroup == null) { return; } MapItemObject.transform.SetParent(MapButtonGroup.transform); MapItemObject.transform.localScale = new Vector3(1, 1, 1); MapItemObject.transform.localPosition = new Vector3(0, 0, 0); itemGroup.Group = MapButtonGroup; // 地图信息对战人数下拉列表 if (bDefaultSelect) { SetCreateRoomMapDesc(sInfo.MapDetailDes, sInfo.PictrueID); UpdateComboBox(sInfo); } ++nIndex; } MapButtonGroup.SetItemSelectedItem(0); PermitObDd.options.Clear(); PermitObDd.options.Add(new Dropdown.OptionData("允许")); PermitObDd.options.Add(new Dropdown.OptionData("拒绝")); PermitObDd.captionText.text = PermitObDd.options.First().text; }