/// <summary> /// 刷新伙伴数据列表 /// </summary> /// <param name="tab_type"></param> private void RefreshPartnerList(eAttrTabType tab_type) { mCurPartnerTabType = tab_type; List <LTPartnerData> partnerList = LTPartnerDataManager.Instance.GetOwnPartnerList(); List <LTPartnerData> filterList = new List <LTPartnerData>(); for (int i = 0; i < partnerList.Count; i++) { if (IsInTransTeam(partnerList[i].HeroId)) { continue; } if (tab_type == eAttrTabType.All) { filterList.Add(partnerList[i]); } else if (tab_type == eAttrTabType.Feng && partnerList[i].HeroInfo.char_type == Hotfix_LT.Data.eRoleAttr.Feng) { filterList.Add(partnerList[i]); } else if (tab_type == eAttrTabType.Huo && partnerList[i].HeroInfo.char_type == Hotfix_LT.Data.eRoleAttr.Huo) { filterList.Add(partnerList[i]); } else if (tab_type == eAttrTabType.Shui && partnerList[i].HeroInfo.char_type == Hotfix_LT.Data.eRoleAttr.Shui) { filterList.Add(partnerList[i]); } } DynamicScroll.SetItemDatas(filterList.ToArray()); SetIconDragAction(); SetBtnState(); }
private void RefreshPartnerList(eAttrTabType tabType) { HeroInfoTemplate[] AllInfo = CharacterTemplateManager.Instance.GetHeroInfos(); List <HeroInfoTemplate> temp = new List <HeroInfoTemplate>(); for (int i = 0; i < AllInfo.Length; i++) { if (AllInfo[i].init_star == 3 && AllInfo[i].draw == 2) { if (tabType == eAttrTabType.All) { temp.Add(AllInfo[i]); } else if (tabType == eAttrTabType.Feng && AllInfo[i].char_type == eRoleAttr.Feng) { temp.Add(AllInfo[i]); } else if (tabType == eAttrTabType.Huo && AllInfo[i].char_type == eRoleAttr.Huo) { temp.Add(AllInfo[i]); } else if (tabType == eAttrTabType.Shui && AllInfo[i].char_type == eRoleAttr.Shui) { temp.Add(AllInfo[i]); } } } LTDrawCardLookupController.DrawType = DrawCardType.none; Scroll.SetItemDatas(temp); }
private void OnClickShuiBtn() { if (mCurPartnerTabType != eAttrTabType.Shui) { mCurPartnerTabType = eAttrTabType.Shui; this.F_SetCardInfos(m_Data); } }
private void OnClickHuoBtn() { if (mCurPartnerTabType != eAttrTabType.Huo) { mCurPartnerTabType = eAttrTabType.Huo; this.F_SetCardInfos(m_Data); } }
private void OnClickFengBtn() { if (mCurPartnerTabType != eAttrTabType.Feng) { mCurPartnerTabType = eAttrTabType.Feng; this.F_SetCardInfos(m_Data); } }
private void OnClickAllBtn() { if (mCurPartnerTabType != eAttrTabType.All) { mCurPartnerTabType = eAttrTabType.All; this.F_SetCardInfos(m_Data); } }
public void OnRaceTabClick(GameObject ui_toggle) { /*if (!ui_toggle.value) * return;*/ mCurPartnerTabType = ParseTabType(ui_toggle.name); RefreshPartnerList(); }
public void OnRaceTabClick(GameObject obj) { if (isOnDrag) { OnDragEnd(); } eAttrTabType tabType = GameUtils.ParseTabType(obj.name); RefreshPartnerList(tabType); }
/// <summary> /// 设置备选卡片信息 /// </summary> /// <param name="allCard">备选的卡片列表</param> public void F_SetCardInfos(HeroBattleChoiceData data) { m_Data = data; mCurPartnerTabType = mCurPartnerTabType == eAttrTabType.None ? eAttrTabType.All : mCurPartnerTabType; List <HeroBattleChoiceCellData> allCard = new List <HeroBattleChoiceCellData>(); switch (mCurPartnerTabType) { case eAttrTabType.Feng: allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Feng]); break; case eAttrTabType.Huo: allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Huo]); break; case eAttrTabType.Shui: allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Shui]); break; case eAttrTabType.All: allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Feng]); allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Huo]); allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Shui]); break; } // for (int i = 0; i < m_AllCardItem.Count; i++) { m_AllCardItem[i].F_SetCardInfo(null); } // 排序 allCard.Sort((x, y) => { int result = y.level.CompareTo(x.level); if (result == 0) { result = y.star.CompareTo(x.star); } return(result); }); // for (int i = 0; i < allCard.Count; i++) { if (i >= m_AllCardItem.Count) { m_AllCardItem.Add(m_CardItem.F_Clone(m_Grid.transform)); } m_AllCardItem[i].F_SetCardInfo(allCard[i]); } m_Grid.Reposition(); m_ScrollView.ResetPosition(); }
public LTPVPPrepareCardHud(Transform transform) { mCurPartnerTabType = eAttrTabType.None; m_CardItem = new LTPVPCardInfoHud(transform.Find("BuddyList/Placeholder/PartnerGrid/Item")); m_AllCardItem = new List <LTPVPCardInfoHud>(); m_Grid = transform.Find("BuddyList/Placeholder/PartnerGrid").GetComponent <UIGrid>(); m_ScrollView = transform.Find("BuddyList").GetComponent <UIScrollView>(); transform.Find("BG/Title/BtnList/AllBtn").GetComponent <UIButton>().onClick.Add(new EventDelegate(OnClickAllBtn)); transform.Find("BG/Title/BtnList/FengBtn").GetComponent <UIButton>().onClick.Add(new EventDelegate(OnClickFengBtn)); transform.Find("BG/Title/BtnList/HuoBtn").GetComponent <UIButton>().onClick.Add(new EventDelegate(OnClickHuoBtn)); transform.Find("BG/Title/BtnList/ShuiBtn").GetComponent <UIButton>().onClick.Add(new EventDelegate(OnClickShuiBtn)); transform.Find("BG/RuleBtn").GetComponent <UIButton>().onClick.Add(new EventDelegate(OnClickRuleBtn)); }
public void OnTitleBtnClick(GameObject obj) { int index = SelectObjList.IndexOf(obj); if (index == (int)curInvType) { return; } if (obj.GetComponent <TweenScale>() != null) { obj.GetComponent <TweenScale>().ResetToBeginning(); obj.GetComponent <TweenScale>().PlayForward(); } curInvType = (eAttrTabType)index; curBtnObj = obj; Show(); }