/// <summary> 메일 UI</summary> void OnInitMailData(List <MailData> data = null) { if (data.Count == 0) { return; } int count = data.Count; for (int i = 0; i < count; i++) { GameObject go = Instantiate(contaninerPrefab); go.transform.SetParent(mailScrollViewContent.transform, false); UIMailSlotContainer mailSlotContainer = go.GetComponent <UIMailSlotContainer>(); mailSlotContainer.SlotInit(data[i]); mailSlotContainerList.Add(mailSlotContainer); } allReceiveButton.interactable = false; for (int i = 0; i < MailManager.Instance.mailDataList.Count; i++) { if (MailManager.Instance.mailDataList[i].itemType == "money") { allReceiveButton.interactable = true; break; } } SizeControl(count); }
/// <summary> 우편 첨부 획득 </summary> public void OnClickReceiveButton(string mailID) { UIMailSlotContainer slot = mailSlotContainerList.Find(x => x.mailData.mailID == mailID); if (slot.mailData.itemType == "buff") { OptionManager.Instance.ApplyBoostByMail(slot.mailData.itemID, System.Convert.ToSingle(slot.mailData.itemAmount)); } MailManager.Instance.ReceiveItme(mailID); mailSlotContainerList.Remove(slot); mailSlotPool.RemoveAt(mailSlotPool.FindIndex(x => x.mailID == mailID)); slot.Receive();//.SetActive(false); mailIDList.Add(mailID); StartCoroutine(PoolRemover(mailIDList)); int count = mailSlotContainerList.Count; SizeControl(count); }