// 点击确认按钮 public void OnEnterBtn(GameObject obj) { GameObject inputFriendID = FindChild("WebSiteInputFriendID"); UIInput inputComponet = inputFriendID.transform.GetComponent <UIInput>(); //Debug.Log(("uifoundFriendByID-----------------:" + inputComponet.value)); //MiniServer.Singleton.SendLookupPlayer_C2CE((int)inputComponet.value); if (inputComponet.value == "") { Debug.Log("------------------------Shu123321123"); return; } int tmpFriendID = int.Parse(inputComponet.value); if (tmpFriendID == User.Singleton.GetUserID()) { //弹出二次提示框Error Self UIFriendMsgBoxCfg boxCfg = FindChild("Button_Enter").GetComponent <UIFriendMsgBoxCfg>(); UIFriendCfgItem friendCfgItem = boxCfg.ItemList[(int)FoundFriendByID.ENMsgInfoType.enErrorSelf]; UIFriendMessageBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, OnButtonRefuserBtn, friendCfgItem); return; } //OnShowMsgBox(FoundFriendByID.ENMsgInfoType.enErrorID); //向服务器发送带查找好友ID int msgID = MiniServer.Singleton.SendLookupPlayer_C2CE(tmpFriendID); RegisterRespondFuncByMessageID(msgID, OnPlayerIDNotFound); //加载loading界面 //Loading.Singleton.Show(); }
//点击FriendItem人物信息回调 public void OnClickPlayer(object sender, EventArgs e) { GameObject obj = (GameObject)sender; Parma parma = obj.transform.parent.GetComponent <Parma>(); Debug.Log("OnClickIPlayer---------------------" + parma.m_id); UIFriendItem friendItem = CreateFriendItemPrefab((FriendItem)FriendList.Singleton.m_friendInfoList[parma.m_id]); UIFriendMessageBox.GetInstance().InsertUIWnd(friendItem); UIFriendMsgBoxCfg FriendboxCfg = FindChild("InnerFrame").GetComponent <UIFriendMsgBoxCfg>(); UIFriendCfgItem friendCfgItem = FriendboxCfg.ItemList[0]; UIFriendMessageBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, OnButtonRefuserBtn, friendCfgItem); }
public void OnShowMsgBox(FoundFriendByID.ENMsgInfoType msgType) { switch (msgType) { case FoundFriendByID.ENMsgInfoType.enErrorID: break; case FoundFriendByID.ENMsgInfoType.enSuccess: /*Loading.Singleton.Hide();*/ UIFriendItem friendItem = CreateFriendItemPrefab(); UIFriendMessageBox.GetInstance().InsertUIWnd(friendItem); UIFriendMsgBoxCfg FriendboxCfg = FindChild("Button_Enter").GetComponent <UIFriendMsgBoxCfg>(); UIFriendCfgItem friendCfgItem = FriendboxCfg.ItemList[(int)FoundFriendByID.ENMsgInfoType.enSuccess]; UIFriendMessageBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, OnButtonRefuserBtn, friendCfgItem); break; default: break; } }
public void ShowMsgBox(OnButtonCallbacked yesCallbacked, OnButtonCallbacked noCallbacked, OnButtonCallbacked refuserCallbacked, UIFriendCfgItem boxCfg) { m_yesCallbacked = yesCallbacked; m_noCallbacked = noCallbacked; m_refuserCallbacked = refuserCallbacked; if (!string.IsNullOrEmpty(boxCfg.yesIcon)) { UISprite sprite = m_yesButton.GetComponent <UISprite>(); sprite.spriteName = boxCfg.yesIcon; } if (!string.IsNullOrEmpty(boxCfg.noIcon)) { UISprite sprite = m_noButton.GetComponent <UISprite>(); sprite.spriteName = boxCfg.noIcon; } // 显示按钮 switch (boxCfg.buttonNum) { case 1: InsertOneButton(); break; case 2: InsertTwoButton(); break; case 3: InsertThreeButton(); break; default: InsertOneButton(); break; } if (boxCfg.isUsePrefab) { int tmpIndex = 0; foreach (string prefabStr in boxCfg.textPrefabList) { UIMsgBoxMainText UITmpText = UIMsgBoxMainText.Load(prefabStr); UITmpText.SetParent(m_messageInfoList[tmpIndex++]); UITmpText.WindowRoot.transform.localPosition = Vector3.zero; UITmpText.ShowWindow(); } } else { int tmpIndex = 0; foreach (string prefabStr in boxCfg.textPrefabList) { UILabel label = m_messageInfoList[tmpIndex++].GetComponent <UILabel>(); if (null != label) { label.text = prefabStr; } } // foreach (GameObject tmpMsg in m_messageInfoList) // { // UILabel label = tmpMsg.GetComponent<UILabel>(); // if (null != label) // { // label.text = boxCfg.textPrefabList[tmpIndex++]; // } // } } if (null != m_insertUIWnd) { m_insertUIWnd.SetParent(m_InsertItemPrefa); m_insertUIWnd.WindowRoot.transform.localPosition = new Vector3(0, 0, 0); m_insertUIWnd.WindowRoot.SetActive(true); m_insertUIWnd.SetLocalScale(Vector3.one); UIPanel panel = m_insertUIWnd.WindowRoot.GetComponent <UIPanel>(); panel.depth = this.WindowRoot.GetComponent <UIPanel>().depth + 1; m_insertUIWnd.ShowWindow(); } ShowWindow(); }