void InitWidget() { //左侧页签 if (m_scrollview_growleftscrollview != null) { m_SecondTabCreator = m_scrollview_growleftscrollview.GetComponent <UISecondTabCreatorBase>(); if (m_SecondTabCreator == null) { m_SecondTabCreator = m_scrollview_growleftscrollview.gameObject.AddComponent <UISecondTabCreatorBase>(); GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uigrowupsecondtypegrid) as GameObject; m_SecondTabCreator.Initialize <UIGrowUpSecondTypeGrid>(cloneFTemp, cloneSTemp /*m_trans_UIGrowUpSecondTypeGrid.gameObject*/, OnUpdateGrowUpCtrTypeGrid, OnUpdateGrowUpSecondTypeGrid, OnGrowUpTypeGridUIEventDlg); } } //战力 if (m_trans_growFightPowerrightscrollview != null) { m_trans_growFightPowerrightscrollview.gameObject.SetActive(true); m_GrowUpFightPowerGridCreator = m_trans_growFightPowerrightscrollview.gameObject.GetComponent <UIGridCreatorBase>(); if (m_GrowUpFightPowerGridCreator == null) { m_GrowUpFightPowerGridCreator = m_trans_growFightPowerrightscrollview.gameObject.AddComponent <UIGridCreatorBase>(); } //UnityEngine.GameObject obj = UIManager.GetResGameObj(GridID.Uigrowupfightpowergrid) as UnityEngine.GameObject; m_GrowUpFightPowerGridCreator.gridContentOffset = new UnityEngine.Vector2(0, 0); m_GrowUpFightPowerGridCreator.arrageMent = UIGridCreatorBase.Arrangement.Vertical; m_GrowUpFightPowerGridCreator.gridWidth = 850; m_GrowUpFightPowerGridCreator.gridHeight = 101; m_GrowUpFightPowerGridCreator.RefreshCheck(); m_GrowUpFightPowerGridCreator.Initialize <UIGrowUpFightPowerGrid>(m_sprite_UIGrowUpFightPowergrid.gameObject, OnGridDataUpdate, OnGridUIEvent); } //活动玩法 if (m_trans_growrightscrollview != null) { m_trans_growrightscrollview.gameObject.SetActive(true); m_GrowUpGridCreator = m_trans_growrightscrollview.gameObject.GetComponent <UIGridCreatorBase>(); if (m_GrowUpGridCreator == null) { m_GrowUpGridCreator = m_trans_growrightscrollview.gameObject.AddComponent <UIGridCreatorBase>(); } //UnityEngine.GameObject obj = UIManager.GetResGameObj(GridID.Uigrowupgrid) as UnityEngine.GameObject; m_GrowUpGridCreator.gridContentOffset = new UnityEngine.Vector2(0, 0); m_GrowUpGridCreator.arrageMent = UIGridCreatorBase.Arrangement.Vertical; m_GrowUpGridCreator.gridWidth = 850; m_GrowUpGridCreator.gridHeight = 101; m_GrowUpGridCreator.RefreshCheck(); m_GrowUpGridCreator.Initialize <UIGrowUpGrid>(m_sprite_UIGrowUpGrid.gameObject, OnGridDataUpdate, OnGridUIEvent); } m_label_btn_analysis_label.text = "马上分析"; }
void InitWidget() { if (m_trans_TeamListScrollView != null) { m_existedTeamGridCreator = m_trans_TeamListScrollView.GetComponent <UIGridCreatorBase>(); if (null == m_existedTeamGridCreator) { m_existedTeamGridCreator = m_trans_TeamListScrollView.gameObject.AddComponent <UIGridCreatorBase>(); } //UnityEngine.GameObject obj = UIManager.GetResGameObj(GridID.Uiexistedteamgrid) as GameObject; m_existedTeamGridCreator.gridContentOffset = new UnityEngine.Vector2(0, 0); m_existedTeamGridCreator.arrageMent = UIGridCreatorBase.Arrangement.Vertical; m_existedTeamGridCreator.gridWidth = 780; m_existedTeamGridCreator.gridHeight = 100; m_existedTeamGridCreator.RefreshCheck(); m_existedTeamGridCreator.Initialize <UIExistedTeamGrid>(m_sprite_UIExistedTeamGrid.gameObject, OnTeamGridDataUpdate, OnTeamGridUIEvent); } if (m_scrollview_TargetScrollView != null) { m_secondsTabCreator = m_scrollview_TargetScrollView.gameObject.GetComponent <UISecondTabCreatorBase>(); if (m_secondsTabCreator == null) { m_secondsTabCreator = m_scrollview_TargetScrollView.gameObject.AddComponent <UISecondTabCreatorBase>(); //UnityEngine.GameObject fObj = UIManager.GetResGameObj(GridID.Uititlectrtypegrid) as GameObject; UnityEngine.GameObject fObj = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; UnityEngine.GameObject sObj = UIManager.GetResGameObj(GridID.Uiteamactivitychildgrid) as GameObject; m_secondsTabCreator.Initialize <UITeamActivityChildGrid>(fObj, sObj, OnUpdateCtrTypeGrid, OnUpdateSecondGrid, OnGridUIEventDlg); } } }
private void InitCanInlayGemWidgets() { if (null == mSecondsTabCreator && null != m_scrollview_GemScrollView) { mSecondsTabCreator = m_scrollview_GemScrollView.GetComponent <UISecondTabCreatorBase>(); if (null != mSecondsTabCreator) { GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uigemgrid) as GameObject; mSecondsTabCreator.Initialize <UIGemGrid>(cloneFTemp, cloneSTemp , OnUpdateInlayGrid, OnUpdateSecondGemGrid, OnInlayGridUIEventDlg); } } }
void InitWidget() { if (m_trans_taskRewardRoot != null) { m_rewardItemGridCreator = m_trans_taskRewardRoot.gameObject.GetComponent <UIGridCreatorBase>(); if (m_rewardItemGridCreator == null) { m_rewardItemGridCreator = m_trans_taskRewardRoot.gameObject.AddComponent <UIGridCreatorBase>(); } //UnityEngine.GameObject obj = UIManager.GetResGameObj(GridID.Uiitemshow) as UnityEngine.GameObject; m_rewardItemGridCreator.gridContentOffset = new UnityEngine.Vector2(0, 0); m_rewardItemGridCreator.arrageMent = UIGridCreatorBase.Arrangement.Horizontal; m_rewardItemGridCreator.gridWidth = 90; m_rewardItemGridCreator.gridHeight = 120; m_rewardItemGridCreator.RefreshCheck(); m_rewardItemGridCreator.Initialize <UIItemShow>((uint)GridID.Uiitemshow, UIManager.OnObjsCreate, UIManager.OnObjsRelease, OnGridDataUpdate, OnGridUIEvent); } //已接任务 if (m_scrollview_alreadyDoMission != null) { m_secondsTabAlreadyDoMissionCreator = m_scrollview_alreadyDoMission.gameObject.GetComponent <UISecondTabCreatorBase>(); if (m_secondsTabAlreadyDoMissionCreator == null) { m_secondsTabAlreadyDoMissionCreator = m_scrollview_alreadyDoMission.gameObject.AddComponent <UISecondTabCreatorBase>(); GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject; m_secondsTabAlreadyDoMissionCreator.Initialize <UISecondTypeGrid>(cloneFTemp, cloneSTemp, OnUpdateMissionCtrTypeGrid, OnUpdateMissionSecondGrid, OnMissionCtrTypeGridUIEventDlg); } } //可接任务 if (m_scrollview_canDoMission != null) { m_secondsTabCanDoMissionCreator = m_scrollview_canDoMission.gameObject.GetComponent <UISecondTabCreatorBase>(); if (m_secondsTabCanDoMissionCreator == null) { m_secondsTabCanDoMissionCreator = m_scrollview_canDoMission.gameObject.AddComponent <UISecondTabCreatorBase>(); GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject; m_secondsTabCanDoMissionCreator.Initialize <UISecondTypeGrid>(cloneFTemp, cloneSTemp, OnUpdateMissionCtrTypeGrid, OnUpdateMissionSecondGrid, OnMissionCtrTypeGridUIEventDlg); } } }
void SetSelectSecondTypeGrid(uint id) { UISecondTabCreatorBase creator = GetSecondTabCreator(); if (creator == null) { return; } List <QuestTraceInfo> taskList = GetQuestListByType(m_selectTaskTypeId); if (taskList == null) { return; } QuestTraceInfo quest = taskList.Find((data) => { return(data.taskId == m_selectTaskId); }); if (quest != null && taskTypeList.Contains(m_selectTaskTypeId)) { UISecondTypeGrid grid = creator.GetGrid <UISecondTypeGrid>(taskTypeList.IndexOf(m_selectTaskTypeId), taskList.IndexOf(quest)); if (grid != null) { grid.SetHightLight(false); } } QuestTraceInfo q = taskList.Find((data) => { return(data.taskId == id); }); if (q != null && taskTypeList.Contains(m_selectTaskTypeId)) { UISecondTypeGrid grid = creator.GetGrid <UISecondTypeGrid>(taskTypeList.IndexOf(m_selectTaskTypeId), taskList.IndexOf(q)); if (grid != null) { grid.SetHightLight(true); ShowTaskInfo(q); this.m_selectTaskId = id; } } }
void InitWidgets() { if (null == mSecondTabCreator) { if (null != m_scrollview_TypeScrollView && null == mSecondTabCreator) { mSecondTabCreator = m_scrollview_TypeScrollView.GetComponent <UISecondTabCreatorBase>(); if (null == mSecondTabCreator) { mSecondTabCreator = m_scrollview_TypeScrollView.gameObject.AddComponent <UISecondTabCreatorBase>(); } if (null != mSecondTabCreator) { // GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; // GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject; mSecondTabCreator.Initialize <UISecondTypeGrid>(m_trans_UICtrTypeGrid.gameObject, m_widget_UISecondTypeGrid.gameObject , OnUpdateGridData, OnUpdateSecondTabGrid, OnGridUIEventDlg); } } } if (null != mSecondTabCreator) { List <int> secondTabsNums = new List <int>(); achieveDic = achievementManager.GetAchieveTypeData(); if (null == mlstFirstTabIds) { mlstFirstTabIds = new List <uint>(); } mlstFirstTabIds.Clear(); if (m_uintDic == null) { m_uintDic = new Dictionary <uint, List <uint> >(); } List <AchievementDataBase> temp = new List <AchievementDataBase>(); List <uint> secIDs = new List <uint>(); foreach (var i in achieveDic) { if (!mlstFirstTabIds.Contains(i.Key)) { mlstFirstTabIds.Add(i.Key); } secIDs.Clear(); for (int m = 0; m < i.Value.Count; m++) { for (int a = 0; a < i.Value.Count; a++) { if (m_uintDic.ContainsKey(i.Key)) { m_uintDic[i.Key].Add(i.Value[a].childType); } else { List <uint> li = new List <uint>(); li.Add(i.Value[a].childType); m_uintDic.Add(i.Key, li); } } } secondTabsNums.Add(i.Value.Count); } if (null != mSecondTabCreator) { mSecondTabCreator.CreateGrids(secondTabsNums); } } if (null != m_ctor_AchievementScrollView) { m_ctor_AchievementScrollView.Initialize <UIAchievemenGrid>(m_trans_UIAchievemenGrid.gameObject, OnUpdateGridData, OnGridUIEventDlg); } }
/// <summary> /// 初始化顶部的grids /// </summary> void InitTitleWidget() { //上面的页签 if (m_ctor_TitleCategoryScrollview != null) { // UnityEngine.GameObject obj = UIManager.GetResGameObj(GridID.Uititlecategorygrid) as UnityEngine.GameObject; m_ctor_TitleCategoryScrollview.arrageMent = UIGridCreatorBase.Arrangement.Horizontal; m_ctor_TitleCategoryScrollview.gridWidth = 141; m_ctor_TitleCategoryScrollview.gridHeight = 50; m_ctor_TitleCategoryScrollview.RefreshCheck(); m_ctor_TitleCategoryScrollview.Initialize <UITitleCategoryGrid>(m_trans_UITitleCategorygrid.gameObject, OnGridDataUpdate, OnGridUIEvent); } //左侧的称号列表(带二级页签) if (m_scrollview_TitleListScrollView != null) { m_secondsTabCreator = m_scrollview_TitleListScrollView.gameObject.GetComponent <UISecondTabCreatorBase>(); if (m_secondsTabCreator == null) { m_secondsTabCreator = m_scrollview_TitleListScrollView.gameObject.AddComponent <UISecondTabCreatorBase>(); GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uititlesecondtypegrid) as GameObject; m_secondsTabCreator.Initialize <UITitleSecondTypeGrid>(cloneFTemp, cloneSTemp, OnUpdateTitileCtrTypeGrid, OnUpdateTitleSecondGrid, OnTitileCtrTypeGridUIEventDlg); } } //附加属性 if (m_trans_AttachedScrollViewContent != null) { m_ForeverPropGridCreator = m_trans_AttachedScrollViewContent.GetComponent <UIGridCreatorBase>(); if (m_ForeverPropGridCreator == null) { m_ForeverPropGridCreator = m_trans_AttachedScrollViewContent.gameObject.AddComponent <UIGridCreatorBase>(); //UnityEngine.GameObject obj = UIManager.GetResGameObj(GridID.Uititleforeverpropgrid) as UnityEngine.GameObject; m_ForeverPropGridCreator.gridContentOffset = new UnityEngine.Vector2(0, 0); m_ForeverPropGridCreator.arrageMent = UIGridCreatorBase.Arrangement.Vertical; m_ForeverPropGridCreator.gridWidth = 250; m_ForeverPropGridCreator.gridHeight = 32; m_ForeverPropGridCreator.RefreshCheck(); m_ForeverPropGridCreator.Initialize <UITitleForeverPropGrid>((uint)GridID.Uititleforeverpropgrid, UIManager.OnObjsCreate, UIManager.OnObjsRelease, OnGridDataUpdate, OnGridUIEvent); } } //激活属性 if (m_trans_UseScrollViewContent != null) { m_ActivatePropGridCreator = m_trans_UseScrollViewContent.GetComponent <UIGridCreatorBase>(); if (m_ActivatePropGridCreator == null) { m_ActivatePropGridCreator = m_trans_UseScrollViewContent.gameObject.AddComponent <UIGridCreatorBase>(); //UnityEngine.GameObject obj = UIManager.GetResGameObj(GridID.Uititleactivatepropgrid) as UnityEngine.GameObject; m_ActivatePropGridCreator.gridContentOffset = new UnityEngine.Vector2(0, 0); m_ActivatePropGridCreator.arrageMent = UIGridCreatorBase.Arrangement.Vertical; m_ActivatePropGridCreator.gridWidth = 250; m_ActivatePropGridCreator.gridHeight = 32; m_ActivatePropGridCreator.RefreshCheck(); m_ActivatePropGridCreator.Initialize <UITitleActivatePropGrid>((uint)GridID.Uititleactivatepropgrid, UIManager.OnObjsCreate, UIManager.OnObjsRelease, OnGridDataUpdate, OnGridUIEvent); } } }
/// <summary> /// 初始化 /// </summary> private void InitWidgets() { if (initWidgets) { return; } initWidgets = true; m_mgr = DataManager.Manager <ComposeManager>(); Transform clone = null; if (null != m_trans_UIIFGTarget && null == m_targetNeedGrid) { clone = m_trans_UIIFGTarget.GetChild(0); if (null != clone) { m_targetNeedGrid = clone.GetComponent <UIComposeNeedGrid>(); if (null == m_targetNeedGrid) { m_targetNeedGrid = clone.gameObject.AddComponent <UIComposeNeedGrid>(); } } m_targetNeedGrid.RegisterUIEventDelegate(OnGridEventDlg); } if (null != m_trans_UIIFGCost1 && null == m_costNeedGrid1) { clone = m_trans_UIIFGCost1.GetChild(0); if (null != clone) { Util.AddChildToTarget(m_trans_UIIFGCost1, clone); m_costNeedGrid1 = clone.GetComponent <UIComposeNeedGrid>(); if (null == m_costNeedGrid1) { m_costNeedGrid1 = clone.gameObject.AddComponent <UIComposeNeedGrid>(); } } m_costNeedGrid1.RegisterUIEventDelegate(OnGridEventDlg); } if (null != m_trans_UIIFGCost2 && null == m_costNeedGrid2) { clone = m_trans_UIIFGCost2.GetChild(0); if (null != clone) { Util.AddChildToTarget(m_trans_UIIFGCost2, clone); m_costNeedGrid2 = clone.GetComponent <UIComposeNeedGrid>(); if (null == m_costNeedGrid2) { m_costNeedGrid2 = clone.gameObject.AddComponent <UIComposeNeedGrid>(); } } m_costNeedGrid2.RegisterUIEventDelegate(OnGridEventDlg); } if (null != m_trans_UIIFGCost3 && null == m_costNeedGrid3) { clone = m_trans_UIIFGCost3.GetChild(0); if (null != clone) { Util.AddChildToTarget(m_trans_UIIFGCost3, clone); m_costNeedGrid3 = clone.GetComponent <UIComposeNeedGrid>(); if (null == m_costNeedGrid3) { m_costNeedGrid3 = clone.gameObject.AddComponent <UIComposeNeedGrid>(); } } m_costNeedGrid3.RegisterUIEventDelegate(OnGridEventDlg); } if (null != m_trans_UIIFGCost4 && null == m_costNeedGrid4) { clone = m_trans_UIIFGCost4.GetChild(0); if (null != clone) { Util.AddChildToTarget(m_trans_UIIFGCost4, clone); m_costNeedGrid4 = clone.GetComponent <UIComposeNeedGrid>(); if (null == m_costNeedGrid4) { m_costNeedGrid4 = clone.gameObject.AddComponent <UIComposeNeedGrid>(); } } m_costNeedGrid4.RegisterUIEventDelegate(OnGridEventDlg); } if (null != m_trans_UIIFGCost5 && null == m_costNeedGrid5) { clone = m_trans_UIIFGCost5.GetChild(0); if (null != clone) { Util.AddChildToTarget(m_trans_UIIFGCost5, clone); m_costNeedGrid5 = clone.GetComponent <UIComposeNeedGrid>(); if (null == m_costNeedGrid5) { m_costNeedGrid5 = clone.gameObject.AddComponent <UIComposeNeedGrid>(); } } m_costNeedGrid5.RegisterUIEventDelegate(OnGridEventDlg); } if (null != m_trans_SingleCompoundCurrency && null == m_composeSingleC) { m_composeSingleC = m_trans_SingleCompoundCurrency.GetComponent <UICurrencyGrid>(); if (null == m_composeSingleC) { m_composeSingleC = m_trans_SingleCompoundCurrency.gameObject.AddComponent <UICurrencyGrid>(); } } if (null != m_trans_CompoundAllCurrency && null == m_composeAllC) { m_composeAllC = m_trans_CompoundAllCurrency.GetComponent <UICurrencyGrid>(); if (null == m_composeAllC) { m_composeAllC = m_trans_CompoundAllCurrency.gameObject.AddComponent <UICurrencyGrid>(); } } //构建1级2级分类页签 if (null != m_scrollview_TypeScrollView && null == mSecondTabCreator) { mSecondTabCreator = m_scrollview_TypeScrollView.GetComponent <UISecondTabCreatorBase>(); if (null != mSecondTabCreator) { GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject; mSecondTabCreator.Initialize <UISecondTypeGrid>(cloneFTemp, cloneSTemp , OnGridUpdate, OnUpdateSecondTabGrid, OnGridEventDlg); } } if (null == mlstFirstTabIds) { mlstFirstTabIds = new List <uint>(); } mlstFirstTabIds.Clear(); List <CategoryTypeData> firstTabDatas = new List <CategoryTypeData>(); firstTabDatas = m_mgr.GetCategoryTypeDatasByFirstType(); if (null == firstTabDatas || firstTabDatas.Count == 0) { Engine.Utility.Log.Error("ComposePanel InitWidgets Error,get cateoryTypeData null"); return; } firstTabDatas.Sort((left, right) => { return((int)left.m_uint_categoryId - (int)right.m_uint_categoryId); }); List <int> secondTabsNums = new List <int>(); CategoryTypeData ctData = null; int num = 0; for (int i = 0; i < firstTabDatas.Count; i++) { ctData = firstTabDatas[i]; num = (null != ctData) ? ctData.Count : 0; secondTabsNums.Add(num); if (!mlstFirstTabIds.Contains(firstTabDatas[i].m_uint_categoryId)) { mlstFirstTabIds.Add(firstTabDatas[i].m_uint_categoryId); } } if (null != mSecondTabCreator) { mSecondTabCreator.CreateGrids(secondTabsNums); } SetSelectFirstType(0, true); UpdateCanComposeRedPoint(); }
public override bool OnMsg(UIMsgID msgid, object param) { switch (msgid) { case UIMsgID.eRefreshTaskDesc: GameCmd.stTaskRewardScriptUserCmd_S taskIntro = (GameCmd.stTaskRewardScriptUserCmd_S)param; if (m_currquest != null && m_currquest.taskId == taskIntro.task_id) { m_lstRewardItemInfo = GetRewardInfoList(taskIntro.exp, taskIntro.money, taskIntro.gold, taskIntro.item_base_id, taskIntro.item_num); m_rewardItemGridCreator.CreateGrids(m_lstRewardItemInfo != null ? m_lstRewardItemInfo.Count : 0); //ShowReward(taskIntro.item_base_id, taskIntro.item_num, taskIntro.gold, taskIntro.money, taskIntro.exp); } break; case UIMsgID.eDeleteTask: { uint taskid = (uint)param; UISecondTabCreatorBase creator = GetSecondTabCreator(); if (creator != null) { //数据删除 creator.RemoveIndex((int)m_selectTaskTypeId, (int)taskid); } RefreshData(true); CreateMissionGrid(m_CurrPage); //默认选中第一个 if (taskTypeList != null && taskTypeList.Count > 0) { SetSelectCtrTypeGrid(taskTypeList[0]); } List <QuestTraceInfo> taskList = GetQuestListByType(m_selectTaskTypeId); if (taskList != null && taskList.Count > 0) { SetSelectSecondTypeGrid(taskList[0].taskId); } /* * UISecondTypeGrid removeGrid = null; * if (m_dicsType.TryGetValue(taskid, out removeGrid)) * { * removeGrid.transform.parent = transform; * removeGrid.gameObject.SetActive(false); * m_dicsType.Remove(taskid); * } * * UITypeGrid grid; * if (m_dicfTypes.TryGetValue(m_uActiveFType, out grid)) * { * grid.UpdatePostion(); * if (grid.ChildCount <= 0) * { * grid.SetHightLight(false); * grid.transform.parent = transform; * grid.gameObject.SetActive(false); * for (uint i = (uint)MissionEnum.None + 1; i < (uint)MissionEnum.Max; i++) * { * if (m_dicfTypes.ContainsKey(i)) * { * SetSelectFirstType(i, true); * break; * } * } * } * else * { * if (grid.ChildCount > 0) * { * MissionEnum missionType = (MissionEnum)grid.Data; * List<QuestTraceInfo> taskList = GetQuestListByType(missionType); * if (taskList != null && taskList.Count > 0) * { * SetSelectSecondType(taskList[0], true); * } * } * } * }*/ } break; default: break; } return(true); }
protected override void OnLoading() { base.OnLoading(); List <BibleDataBase> list = GameTableManager.Instance.GetTableList <BibleDataBase>(); for (int i = 0; i < list.Count; i++) { if (!bibleDic.ContainsKey(list[i].firID)) { temp = new List <BibleDataBase>(); temp.Add(list[i]); bibleDic.Add(list[i].firID, temp); } else { bibleDic[list[i].firID].Add(list[i]); } } if (m_scrollview_TypeScrollView != null) { if (mSecondTabCreator == null) { mSecondTabCreator = m_scrollview_TypeScrollView.gameObject.AddComponent <UISecondTabCreatorBase>(); } if (null != mSecondTabCreator) { // GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; // GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject; mSecondTabCreator.Initialize <UISecondTypeGrid>(m_trans_UICtrTypeGrid.gameObject, m_widget_UISecondTypeGrid.gameObject , onUpdateGrid, OnUpdateSecondTabGrid, OnGridUIEvent); } List <int> secondTabsNums = new List <int>(); if (null == mlstFirstTabIds) { mlstFirstTabIds = new List <uint>(); } if (m_dic == null) { m_dic = new Dictionary <uint, List <uint> >(); } mlstFirstTabIds.Clear(); m_dic.Clear(); foreach (var i in bibleDic) { mlstFirstTabIds.Add(i.Key); secondTabsNums.Add(i.Value.Count); for (int a = 0; a < i.Value.Count; a++) { if (m_dic.ContainsKey(i.Key)) { m_dic[i.Key].Add(i.Value[a].secID); } else { List <uint> li = new List <uint>(); li.Add(i.Value[a].secID); m_dic.Add(i.Key, li); } } } if (null != mSecondTabCreator) { mSecondTabCreator.CreateGrids(secondTabsNums); } } ParseFromFile(); }
protected override void OnLoading() { base.OnLoading(); stRequestOrderListRelationUserCmd_C cmd = new stRequestOrderListRelationUserCmd_C(); OrderListType xx = (OrderListType)Enum.Parse(typeof(OrderListType), "OrderListType_Level"); cmd.type = xx; NetService.Instance.Send(cmd); Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.RANKDATAREFRESH, EventCallBack); rankDic = DataManager.Manager <RankManager>().GetRankDataByFirstType(); //GameObject obj = UIManager.GetResGameObj(GridID.Uirankgrid) as GameObject; if (m_ctor_RankScroll != null) { m_ctor_RankScroll.RefreshCheck(); m_ctor_RankScroll.Initialize <UIRankGrid>(m_trans_UIRankGrid.gameObject, OnRankGridDataUpdate, OnRankGridUIEvent); } if (mSecondTabCreator == null) { if (null != m_scrollview_TypeScrollView && null == mSecondTabCreator) { mSecondTabCreator = m_scrollview_TypeScrollView.GetComponent <UISecondTabCreatorBase>(); if (null == mSecondTabCreator) { mSecondTabCreator = m_scrollview_TypeScrollView.gameObject.AddComponent <UISecondTabCreatorBase>(); } if (null != mSecondTabCreator) { // GameObject cloneFTemp = UIManager.GetResGameObj(GridID.Uictrtypegrid) as GameObject; // GameObject cloneSTemp = UIManager.GetResGameObj(GridID.Uisecondtypegrid) as GameObject; mSecondTabCreator.Initialize <UISecondTypeGrid>(m_trans_UICtrTypeGrid.gameObject, m_widget_UISecondTypeGrid.gameObject , OnRankGridDataUpdate, OnUpdateSecondTabGrid, OnRankGridUIEvent); } } } List <int> secondTabsNums = new List <int>(); if (null == mlstFirstTabIds) { mlstFirstTabIds = new List <uint>(); } if (m_dic == null) { m_dic = new Dictionary <uint, List <uint> >(); } mlstFirstTabIds.Clear(); m_dic.Clear(); foreach (var i in rankDic) { mlstFirstTabIds.Add(i.Key); secondTabsNums.Add(i.Value.Count); for (int a = 0; a < i.Value.Count; a++) { if (m_dic.ContainsKey(i.Key)) { m_dic[i.Key].Add(i.Value[a].childID); } else { List <uint> li = new List <uint>(); li.Add(i.Value[a].childID); m_dic.Add(i.Key, li); } } } if (null != mSecondTabCreator) { mSecondTabCreator.CreateGrids(secondTabsNums); } }