/// <summary> /// 判断是否需要打开奖励显示窗口 /// </summary> private void WhetherOpenPopupWindow() { int _iconNum = 0; if (m_PopupData_Num < 0) { return; } m_AwardIconData.Clear(); m_AwardWindow.SetActive(true); foreach (Transform child in m_itemParent.transform) { Destroy(child.gameObject); } for (int k = 0; k < m_PopupData_Num; k++) { List <int> _tempList = m_MergeData[m_TeamId]; GameactivityTemplate _Data = (GameactivityTemplate)DataTemplate.GetInstance().m_GameactivityTable.getTableData(_tempList[0]); string[] dropArray = _Data.getDropdes().Split('#'); for (int j = 0; j < _Data.getDropdestype().Length; j++) { _iconNum++; AwardIconData _temp = new AwardIconData(); _temp.m_index = j; _temp.m_GameactivityTemplate = _Data; m_AwardIconData.Add(_temp); } } m_AwardIconLayout.cellCount = _iconNum; m_AwardIconLayout.updateCellEvent = UpdateAwardIconItem; m_AwardIconLayout.Reload(); m_PopupData_Num = -1; }
private void GreatAwardItem(int _key, GameactivityTemplate _GameactivityTemplate, UniversalItemCell m_Cell) { int _num = -1; int[] dropdestypeArray = _GameactivityTemplate.getDropdestype(); string[] DropdesArray = _GameactivityTemplate.getDropdes().Split('#'); int[] numdesArray = _GameactivityTemplate.getNumdes();; string[] TextdesArray = _GameactivityTemplate.getTextdes().Split('#'); if (numdesArray.Length != 0) { if (numdesArray[0] != -1) { _num = numdesArray[_key]; } } if (dropdestypeArray[_key] == 1) { int itemid = int.Parse(DropdesArray[_key]); int type = itemid / 1000000; switch (type) { case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RES: ResourceindexTemplate _temp_res = (ResourceindexTemplate)DataTemplate.GetInstance().m_ResourceindexTemplate.getTableData(itemid); if (_temp_res != null) { m_Cell.InitByID(itemid, _num); m_Cell.SetText(GameUtils.getString(_temp_res.getName()), "", ""); } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE: //符文 { ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid); if (itemTable != null) { m_Cell.InitByID(itemid, -1); m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", ""); } } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_COMMON: { ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid); if (itemTable != null) { m_Cell.InitByID(itemid, _num); m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", ""); } } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO: { HeroTemplate hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(itemid); if (hero != null) { m_Cell.InitByID(itemid, _num); m_Cell.SetText(GameUtils.getString(hero.getTitleID()), "", ""); } } break; default: break; } } if (dropdestypeArray[_key] == 0) { m_Cell.SetText(GameUtils.getString(TextdesArray[_key]), "", ""); Sprite sprite = UIResourceMgr.LoadSprite(common.defaultPath + TextdesArray[_key]); m_Cell.InitBySprite(sprite); } }
private void GreatItem(int _key, GameactivityTemplate _GameactivityTemplate, ActivityOverviewData _ActivityOverviewData) { m_Cell = UniversalItemCell.GenerateItem(m_IconItemParent.transform); int _Daymax = _GameactivityTemplate.getDaymax(); if (_Daymax == -1) { _Daymax = 1000000; } if (_ActivityOverviewData.m_todaynum < _Daymax) { m_Cell.SetCheckClaim(false, ""); } else { if (_ActivityOverviewData.m_cangetnum == 0) { m_Cell.SetCheckClaim(true, ""); } else { m_Cell.SetCheckClaim(false, ""); } } int[] dropdestypeArray = _GameactivityTemplate.getDropdestype(); string[] DropdesArray = _GameactivityTemplate.getDropdes().Split('#'); int[] numdesArray = _GameactivityTemplate.getNumdes();; string[] TextdesArray = _GameactivityTemplate.getTextdes().Split('#'); int _num = -1; if (numdesArray.Length != 0) { if (numdesArray[_key] != -1) { _num = numdesArray[_key]; } } if (dropdestypeArray[_key] == 1) { int itemid = int.Parse(DropdesArray[_key]); int type = itemid / 1000000; switch (type) { case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RES: ResourceindexTemplate _temp_res = (ResourceindexTemplate)DataTemplate.GetInstance().m_ResourceindexTemplate.getTableData(itemid); if (_temp_res != null) { m_Cell.InitByID(itemid, _num); m_Cell.SetText(GameUtils.getString(_temp_res.getName()), "", ""); } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE: //符文 { ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid); if (itemTable != null) { m_Cell.InitByID(itemid, -1); m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", ""); } } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_COMMON: { ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid); if (itemTable != null) { m_Cell.InitByID(itemid, _num); m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", ""); } } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO: { HeroTemplate hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(itemid); if (hero != null) { m_Cell.InitByID(itemid, _num); m_Cell.SetText(GameUtils.getString(hero.getTitleID()), "", ""); } } break; default: break; } } if (dropdestypeArray[_key] == 0) { m_Cell.SetText(GameUtils.getString(TextdesArray[_key]), "", ""); if (TextdesArray[_key] != string.Empty) { Sprite sprite = UIResourceMgr.LoadSprite(common.defaultPath + TextdesArray[_key]); m_Cell.InitBySprite(sprite); } } }