public static BePowerListItem CreateItem(GameObject grid, GameObject resItem, string name, BePowerWindow parent, BePowerData.BePowerListItemData data) { GameObject curItem = Utils.BindObjToParent(resItem, grid, name); if (null != curItem) { BePowerListItem curItemComponent = curItem.GetComponent <BePowerListItem>(); if (null != curItemComponent) { curItemComponent.SetData(parent, data); } return(curItemComponent); } return(null); }
void OnLoadItem(GameObject resItem, object param) { if (m_LabelNullTips != null) { m_LabelNullTips.SetActive((BePowerData.curDataList.Count <= 0)); } if (MemberListGrid != null) { Utils.CleanGrid(MemberListGrid); for (int i = 0; i < BePowerData.curDataList.Count; ++i) { BePowerListItem item = BePowerListItem.CreateItem(MemberListGrid, resItem, BePowerData.curDataList[i].function.ToString(), this, BePowerData.curDataList[i]); } MemberListGrid.GetComponent <UIGrid>().Reposition(); MemberListGrid.GetComponent <UITopGrid>().Recenter(true); ShowLeftList(); } }