public void UpdateUI(int id) { if (!DataReader <DuiWuMuBiao> .Contains(id)) { return; } this.TeamTargetCfgID = id; DuiWuMuBiao duiWuMuBiao = DataReader <DuiWuMuBiao> .Get(id); this.dungeonType = duiWuMuBiao.Type; this.challegeIDList = duiWuMuBiao.FuBen; this.btnText.set_text(GameDataUtils.GetChineseContent(duiWuMuBiao.Word, false)); }
public void UpdateUI(int id) { if (!DataReader <DuiWuMuBiao> .Contains(id)) { return; } DuiWuMuBiao duiWuMuBiao = DataReader <DuiWuMuBiao> .Get(id); this.m_teamTargetCfg = duiWuMuBiao; this.dungeonType = duiWuMuBiao.Type; this.teamFirstBtn.FindChild("btnText").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(duiWuMuBiao.Word, false)); this.SetSecondTypeBtns(); this.Selected = false; this.IsShowSecond = false; }
public void UpdateUI(DuiWuMuBiao targetCfg) { if (targetCfg == null) { return; } if (!this.isInit) { this.InitUI(); } this.TeamTargetCfgData = targetCfg; this.dungeonType = this.teamTargetCfg.Type; this.challegeIDList = this.teamTargetCfg.FuBen; this.targetText.set_text(GameDataUtils.GetChineseContent(this.teamTargetCfg.Set, false)); this.Selected = false; }
public void SetDungeonType(DungeonType.ENUM type = DungeonType.ENUM.Other) { List <int> dungeonParams = (TeamBasicManager.Instance.MyTeamData == null) ? new List <int>() : TeamBasicManager.Instance.MyTeamData.ChallengeIDParams; DuiWuMuBiao teamTargetCfg = TeamBasicManager.Instance.GetTeamTargetCfg(type, dungeonParams); if (teamTargetCfg == null || teamTargetCfg.Button != 1 || !TeamBasicManager.Instance.IsTeamLeader()) { if (this.goToDungeonBtn.get_gameObject().get_activeSelf()) { this.goToDungeonBtn.get_gameObject().SetActive(false); } } else if (!this.goToDungeonBtn.get_gameObject().get_activeSelf()) { this.goToDungeonBtn.get_gameObject().SetActive(true); } }
private void OnClickCreateBtn(GameObject go) { if (TeamBasicManager.Instance.MyTeamData == null && this.currentBtnTypeItem != null) { int num = this.currentBtnTypeItem.DungeonType; if (num <= 1) { num = 100; } int systemID = 0; DuiWuMuBiao teamTargetCfg = TeamBasicManager.Instance.GetTeamTargetCfg((DungeonType.ENUM)num, this.currentBtnTypeItem.DungeonParams); if (teamTargetCfg != null) { systemID = teamTargetCfg.SystemId; } TeamBasicManager.Instance.OnMakeTeamByDungeonType((DungeonType.ENUM)num, this.currentBtnTypeItem.DungeonParams, systemID); } }
public bool SetSelectTeamTargetID(int teamTargetCfgID) { if (this.m_teamTargetCfg != null && DataReader <DuiWuMuBiao> .Contains(teamTargetCfgID)) { DuiWuMuBiao duiWuMuBiao = DataReader <DuiWuMuBiao> .Get(teamTargetCfgID); if (duiWuMuBiao.Type == this.m_teamTargetCfg.Type && duiWuMuBiao.Group == this.m_teamTargetCfg.Group) { for (int i = 0; i < this.teamSecondBtnList.get_Count(); i++) { TeamSecondBtnTypeItem component = this.teamSecondBtnList.get_Item(i).GetComponent <TeamSecondBtnTypeItem>(); if (component != null && component.TeamTargetCfgID == teamTargetCfgID) { this.OnClickSecondBtn(this.teamSecondBtnList.get_Item(i).get_gameObject()); } } return(true); } } return(false); }
private void SetSecondTypeBtns() { if (this.m_teamTargetCfg != null) { List <DuiWuMuBiao> list = DataReader <DuiWuMuBiao> .DataList.FindAll((DuiWuMuBiao a) => a.Type == this.m_teamTargetCfg.Type && a.label != 1 && this.m_teamTargetCfg.Group == a.Group); List <DuiWuMuBiao> list2 = new List <DuiWuMuBiao>(); if (list != null && list.get_Count() > 0) { for (int i = 0; i < list.get_Count(); i++) { DuiWuMuBiao duiWuMuBiao = list.get_Item(i); if (duiWuMuBiao != null && duiWuMuBiao.Lv <= EntityWorld.Instance.EntSelf.Lv) { list2.Add(duiWuMuBiao); } } } int j = 0; if (list2 != null && list2.get_Count() > 0) { while (j < list2.get_Count()) { DuiWuMuBiao duiWuMuBiao2 = list2.get_Item(j); if (j < this.teamSecondBtnList.get_Count()) { Transform transform = this.teamSecondBtnList.get_Item(j); transform.get_gameObject().SetActive(true); transform.GetComponent <TeamSecondBtnTypeItem>().UpdateUI(duiWuMuBiao2.Id); } else { GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("TeamSecondTypeBtn"); instantiate2Prefab.set_name("TeamSecondTypeBtn" + duiWuMuBiao2.Id); instantiate2Prefab.get_transform().SetParent(base.get_transform()); instantiate2Prefab.GetComponent <RectTransform>().set_localScale(Vector3.get_one()); this.teamSecondBtnList.Add(instantiate2Prefab.get_transform()); TeamSecondBtnTypeItem component = instantiate2Prefab.GetComponent <TeamSecondBtnTypeItem>(); component.UpdateUI(duiWuMuBiao2.Id); component.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickSecondBtn); if (j == 0) { this.lastSecondBtnTypeItem = component; component.Selected = true; this.DungeonParams = this.lastSecondBtnTypeItem.DungeonParams; } else { component.Selected = false; } } j++; } } for (int k = j; k < this.teamSecondBtnList.get_Count(); k++) { GameObject gameObject = this.teamSecondBtnList.get_Item(k).get_gameObject(); if (gameObject != null && gameObject.get_activeSelf()) { gameObject.SetActive(false); } } } }