void hideHightLight() { for (int i = 0; i < m_GridTranForm.childCount; i++) { RelationNameListItem item = m_GridTranForm.GetChild(i).GetComponent <RelationNameListItem>(); if (item != null) { item.hideHightLight(); } } }
void UpdateRestaurantVisitState() { for (int i = 0; i < m_GridTranForm.childCount; i++) { RelationNameListItem item = m_GridTranForm.GetChild(i).GetComponent <RelationNameListItem>(); if (item != null) { item.UpdateRestaurantVisitState(); } } }
void SetRestaurantInfo() { for (int i = 0; i < m_GridTranForm.childCount; i++) { RelationNameListItem item = m_GridTranForm.GetChild(i).GetComponent <RelationNameListItem>(); { if (item != null) { item.SetRestaurantItemInfo(); } } } }
public static RelationNameListItem CreateItem(GameObject grid, GameObject resItem, string name, RelationNamePopController parentWindow, Relation relationData) { GameObject curItem = Utils.BindObjToParent(resItem, grid); if (null == curItem) { LogModule.ErrorLog("CreateItem, curItem error!"); } curItem.name = name; RelationNameListItem curItemComponent = curItem.GetComponent <RelationNameListItem>(); if (null == curItemComponent) { LogModule.ErrorLog("relation list item error!"); ResourceManager.DestroyResource(ref curItem); return(null); } curItemComponent.SetData(parentWindow, relationData); return(curItemComponent); }
public void OnItemClick(RelationNameListItem curItem) { if (m_bPopWindow) { m_bRestaurantFriend = false; UIManager.CloseUI(UIInfo.RelationNamePopWindow); } if (null != m_delChooseName) { ulong curID = 0; if (ulong.TryParse(curItem.gameObject.name, out curID)) { Dictionary <ulong, Relation> relationList = GameManager.gameManager.PlayerDataPool.FriendList.RelationDataList; m_delChooseName(curID, relationList[curID].Name); } } hideHightLight(); }
void OnLoadItem(GameObject resItem, object param) { if (null == resItem) { LogModule.ErrorLog("load RelationNameListItem fail"); return; } Utils.CleanGrid(ListGrid); Dictionary <ulong, Relation> relationList = GameManager.gameManager.PlayerDataPool.FriendList.RelationDataList; foreach (ulong key in relationList.Keys) { RelationNameListItem.CreateItem(ListGrid, resItem, key.ToString(), this, relationList[key]); if (m_bRestaurantFriend) { SetRestaurantInfo(); UpdateRestaurantVisitState(); } } ListGrid.GetComponent <UIGrid>().Reposition(); ListGrid.GetComponent <UITopGrid>().Recenter(true); }