void CreateTitleItem(TitleItemTableItem item) { if (item == null) { return; } TitleGroupUI groupUI = getGroupUIById(item.groupId); if (groupUI == null) { return; } GameObject go = WindowManager.Instance.CloneGameObject(mItemObj); if (go == null) { return; } go.name = item.id.ToString(); go.SetActive(true); TitleItemUI ui = new TitleItemUI(go); ui.SetData(item); groupUI.AddChild(go); mItemUIs.Add(item.id, ui); UIEventListener.Get(go).onClick = onTitleItemClick; }
void onTitleGroupClick(GameObject go) { if (go == null) { return; } int groupId = System.Convert.ToInt32(go.name); if (!mGroupUIs.ContainsKey(groupId)) { return; } TitleGroupUI ui = mGroupUIs[groupId]; ui.OpenOrClose(); }
void CreateGroupTitle(int id) { GameObject go = WindowManager.Instance.CloneGameObject(mGroupObj); if (go == null) { return; } go.name = id.ToString(); go.transform.parent = mGrid.transform; go.transform.localScale = Vector3.one; go.SetActive(true); TitleGroupUI ui = new TitleGroupUI(go); TitleGroupTableItem data = TitleModule.GetTitleGroupItemById(id); ui.SetData(data); mGroupUIs.Add(id, ui); UIEventListener.Get(go).onClick = onTitleGroupClick; }