private void OnClicMail(ButtonScript obj, object args, int param1, int param2) { COM_Mail mail = obj.GetComponent <mailCellUI> ().Mail; if (mail == null) { return; } if (!delMailBtn.gameObject.activeSelf) { delMailBtn.gameObject.SetActive(true); } if (!mail.isRead_) { obj.GetComponent <mailCellUI>().icon.spriteName = "dakaixin"; } _selectMail = mail; mail.isRead_ = true; NetConnection.Instance.readMail(_selectMail.mailId_); rightImg.gameObject.SetActive(true); for (int k = 0; k < mailCellList.Count; k++) { mailCellList[k].GetComponent <mailCellUI> ().back.gameObject.SetActive(false); } obj.GetComponent <mailCellUI> ().back.gameObject.SetActive(true); updateMailInfo(mail); }
void OnUpdateMailEvent(COM_Mail mail) { NetWaitUI.HideMe(); if (mail.mailId_ == _selectMail.mailId_) { _selectMail = mail; UpdateList(); updateMailInfo(mail); } }
public void updateMailOk(COM_Mail mail) { for (int i = 0; i < _mails.Count; i++) { if (_mails[i].mailId_ == mail.mailId_) { _mails[i] = mail; break; } } if (UpdatemailEnven != null) { UpdatemailEnven(mail); } }
void updateMailInfo(COM_Mail mail) { tetleLab.text = mail.title_; infoLab.text = mail.content_; for (int k = 0; k < itemCellList.Count; k++) { itemCellList[k].transform.parent = null; itemCellList[k].gameObject.SetActive(false); itemCellPoolList.Add(itemCellList[k]); } itemCellList.Clear(); getRewordBtn.gameObject.SetActive(false); if (mail.money_ > 0) { GameObject mobj; if (itemCellPoolList.Count > 0) { mobj = itemCellPoolList[0]; itemCellPoolList.Remove(itemCellPoolList[0]); } else { mobj = UIManager.Instance.InstantiateBagCellUIObj().gameObject; } mobj.GetComponent <ItemCellUI>().itemId = 5035; mobj.GetComponent <ItemCellUI>().ItemCount = mail.money_; mobj.AddComponent <UIDragScrollView>(); mobj.transform.parent = itemGrid.transform; mobj.transform.localPosition = Vector3.zero; mobj.transform.localScale = Vector3.one; mobj.SetActive(true); itemCellList.Add(mobj); getRewordBtn.gameObject.SetActive(true); } if (mail.diamond_ > 0) { GameObject mobj; if (itemCellPoolList.Count > 0) { mobj = itemCellPoolList[0]; itemCellPoolList.Remove(itemCellPoolList[0]); } else { mobj = UIManager.Instance.InstantiateBagCellUIObj().gameObject; } mobj.GetComponent <ItemCellUI>().itemId = 5034; mobj.GetComponent <ItemCellUI>().ItemCount = mail.diamond_; mobj.AddComponent <UIDragScrollView>(); mobj.transform.parent = itemGrid.transform; mobj.transform.localPosition = Vector3.zero; mobj.transform.localScale = Vector3.one; mobj.SetActive(true); itemCellList.Add(mobj); getRewordBtn.gameObject.SetActive(true); } for (int i = 0; i < mail.items_.Length; i++) { GameObject obj1; if (itemCellPoolList.Count > 0) { obj1 = itemCellPoolList[0]; itemCellPoolList.Remove(itemCellPoolList[0]); } else { obj1 = UIManager.Instance.InstantiateBagCellUIObj().gameObject; } obj1.GetComponent <ItemCellUI>().itemId = (uint)mail.items_[i].itemId_; obj1.GetComponent <ItemCellUI>().showTips = true; obj1.GetComponent <ItemCellUI>().ItemCount = mail.items_[i].itemStack_; obj1.AddComponent <UIDragScrollView>(); obj1.transform.parent = itemGrid.transform; obj1.transform.localPosition = Vector3.zero; obj1.transform.localScale = Vector3.one; obj1.SetActive(true); itemCellList.Add(obj1); } if (mail.items_.Length > 0) { getRewordBtn.gameObject.SetActive(true); } itemGrid.Reposition(); }