using TMPro; using UnityEngine; using IVDataFormat; public class EScrNotice : EScrCell { private ButtonIV btnView; private TextMeshProUGUI txtTitle, txtDate; public override void InitCell() { Transform trf = transform; txtTitle = trf.Find("txtTitle").GetComponent(); txtDate = trf.Find("txtDate").GetComponent(); btnView = trf.Find("btnView").GetComponent(); btnView.transform.GetChild(0).GetComponent().text = LocalizationText.GetText("all_see"); } public override void Localize() { btnView.transform.GetChild(0).GetComponent().text = LocalizationText.GetText("all_see"); } public override void SetData(int itemid) { itemID = itemid; if (!DataHandler.TryGetNotice(itemid, out dNotice targetNotice)) return; txtTitle.text = targetNotice.GetTitle(); txtDate.text = FormatString.TextDateTimeUtc9Line1(targetNotice.endAt); } public override void RefreshCellView() { base.RefreshCellView(); SetData(itemID); } public void BtnView() { SoundMgr.Instance.PlaySfx(SoundName.BtnPress); NoticeMgr.SOpenDetail(itemID); } }