protected override void UpdateShow() { NormalInfoData data = GetData <NormalInfoData>(); transform.Find("Name").GetComponent <Text>().text = data.Name; transform.Find("Age").GetComponent <Text>().text = data.Age.ToString(); transform.Find("Count").GetComponent <Text>().text = data.Count.ToString(); }
public void UpdataData(IData newData) { data = (NormalInfoData)newData; if (UpdateShow != null) { UpdateShow(); } }
protected override void Init() { base.Init(); InitUI(EUiId.DIALOG, NormalInfoDataHandler.NAME); UITool.AddBtnListener(transform, () => { AppUIRoot.UIManager.Back(); }, "Back"); UITool.AddBtnListener(transform, () => { AppUIRoot.UIManager.ShowUI(EUiId.VIEW_ONE); }, "One"); UITool.AddBtnListener(transform, () => { AppUIRoot.UIManager.ShowUI(EUiId.SIDE_VIEW); }, "Side"); UITool.AddBtnListener(transform, () => { NormalInfoData data = GetData <NormalInfoData>(); data.Count++; dataHandler.UpdataData(data); }, "Count"); }
protected override void Init() { base.Init(); InitUI(EUiId.VIEW_ONE, NormalInfoDataHandler.NAME); UITool.AddBtnListener(transform, () => { AppUIRoot.UIManager.Back(); }, "Back"); UITool.AddBtnListener(transform, () => { AppUIRoot.UIManager.ShowUI(EUiId.VIEW_TWO); }, "Two"); UITool.AddBtnListener(transform, () => { AppUIRoot.UIManager.ShowUI(EUiId.MAIN_UI); }, "Main"); UITool.AddBtnListener(transform, () => { NormalInfoData data = GetData <NormalInfoData>(); data.Count++; dataHandler.UpdataData(data); }, "Count"); }
public void InitData() { data = new NormalInfoData("BlueMonk", 28, 1); }