/// <summary> /// 设置圣域守卫战奖励数据 /// </summary> public void SetSanctuaryGridListData(List <int> listSancturyID) { for (int index = 0; index < listSancturyID.Count; index++) { if (m_mapGrid.ContainsKey(index)) { RankingRewardUIGrid gridUI = m_mapGrid[index]; gridUI.LoadResourceInsteadOfAwake(); string title = string.Format(LanguageData.GetContent(46908), index + 1); List <string> tips = SanctuaryRewardXMLData.GetWeekRewardNameList(index); string info = ""; for (int i = 0; i < tips.Count; i++) { if (i == 0) { info += tips[i]; } else { info += string.Concat(LanguageData.GetContent(46909), tips[i]); } } gridUI.Index = index; gridUI.SetRankingReward(title, info); } } }
/// <summary> /// 添加记录Grid /// </summary> /// <param name="num"></param> /// <param name="act"></param> void AddUIGridList(int num, Action act = null) { ClearUIGridList(); ResetGridListCameraPos(); ShowUIArrow(num); // 删除翻页位置 //m_gridListMyDragableCamera.DestroyMovePagePosList(); m_gridListMyDragableCamera.FPageHeight = ITEMSPACEVERTICAL * GRID_COUNT_ONE_PAGE; if (num == 0) { if (act != null) { act(); } return; } for (int i = 0; i < num; ++i) { INSTANCE_COUNT++; MogoGlobleUIManager.Instance.ShowWaitingTip(true); int index = i; AssetCacheMgr.GetUIInstance("RankingRewardUIGrid.prefab", (prefab, guid, go) => { GameObject obj = (GameObject)go; obj.transform.parent = m_tranUIGridlList; obj.transform.localPosition = new Vector3(0, ITEMSPACEVERTICAL * index, 0); obj.transform.localScale = new Vector3(1f, 1f, 1f); obj.GetComponentsInChildren <MyDragCamera>(true)[0].RelatedCamera = m_gridListCamera; RankingRewardUIGrid gridUI = obj.AddComponent <RankingRewardUIGrid>(); if (m_mapGrid.ContainsKey(index)) { AssetCacheMgr.ReleaseInstance(m_mapGrid[index].gameObject); } m_mapGrid[index] = gridUI; m_gridListMyDragableCamera.MAXY = OFFSET_Y; if (m_mapGrid.Count > GRID_COUNT_ONE_PAGE) { m_gridListMyDragableCamera.MINY = (m_mapGrid.Count - GRID_COUNT_ONE_PAGE) * ITEMSPACEVERTICAL + OFFSET_Y; } else { m_gridListMyDragableCamera.MINY = m_gridListMyDragableCamera.MAXY; } INSTANCE_COUNT--; if (INSTANCE_COUNT <= 0) { MogoGlobleUIManager.Instance.ShowWaitingTip(false); } // 创建翻页位置 //if (index % GRID_COUNT_ONE_PAGE == 0) //{ // GameObject trans = new GameObject(); // trans.transform.parent = m_gridListCamera.transform; // trans.transform.localPosition = new Vector3(0, index / GRID_COUNT_ONE_PAGE * ITEMSPACEVERTICAL * GRID_COUNT_ONE_PAGE + OFFSET_Y, 0); // trans.transform.localEulerAngles = Vector3.zero; // trans.transform.localScale = new Vector3(1, 1, 1); // trans.name = "GridListPosHorizon" + index / GRID_COUNT_ONE_PAGE; // m_gridListMyDragableCamera.transformList.Add(trans.transform); //} if (index == num - 1) { if (act != null) { act(); } } }); } }