private void SetTitleDetail(GUISelectPanelTitle listUI, GameWebAPI.RespDataMA_TitleMaster.TitleM[] titleData) { TitleListItem[] componentsInChildren = listUI.GetComponentsInChildren <TitleListItem>(true); if (componentsInChildren == null) { return; } GameWebAPI.RespDataTL_GetUserTitleList.UserTitleList equipedUserTitle = TitleDataMng.GetEquipedUserTitle(); int num = 0; for (int i = 0; i < componentsInChildren.Length; i++) { bool owned = null != TitleDataMng.GetUserTitleByMasterId(titleData[i].titleId); bool flag = equipedUserTitle != null && equipedUserTitle.titleId == titleData[i].titleId; componentsInChildren[i].SetDetail(titleData[i], owned, flag, new Action <TitleListItem>(this.OnSelectTitle)); if (flag) { num = i; } } componentsInChildren[num].OnSelectTitle(); }
private void CreateTitleList(GUISelectPanelTitle listUI, int listItemCount) { GUICollider component = listUI.GetComponent <GUICollider>(); BoxCollider component2 = component.GetComponent <BoxCollider>(); Vector3 localPosition = component.transform.localPosition; component.SetOriginalPos(this.titleListOriginalItem.transform.localPosition); component.transform.localPosition = localPosition; Rect listWindowViewRect = new Rect { xMin = component2.size.x * -0.5f, xMax = component2.size.x * 0.5f, yMin = component2.size.y * -0.5f - 40f, yMax = component2.size.y * 0.5f }; listWindowViewRect.yMin = listWindowViewRect.y - GUIMain.VerticalSpaceSize; listWindowViewRect.yMax = listWindowViewRect.y + listWindowViewRect.height + GUIMain.VerticalSpaceSize; listUI.ListWindowViewRect = listWindowViewRect; listUI.selectParts = this.titleListOriginalItem; listUI.initLocation = true; listUI.AllBuild(listItemCount); }