private void RefreshTargetList() { this.teamTargetListPool.Clear(); List <DuiWuMuBiao> allTeamTargetList = TeamBasicManager.Instance.GetAllTeamTargetCfgList(); if (allTeamTargetList != null && allTeamTargetList.get_Count() > 0) { this.teamTargetListPool.Create(allTeamTargetList.get_Count(), delegate(int index) { if (index < allTeamTargetList.get_Count() && index < this.teamTargetListPool.Items.get_Count()) { TeamTargetItem component = this.teamTargetListPool.Items.get_Item(index).GetComponent <TeamTargetItem>(); if (component != null) { component.UpdateUI(allTeamTargetList.get_Item(index)); component.Selected = (index == 0); if (index == 0) { this.OnClickSelectTarget(component.get_gameObject()); } else { component.Selected = false; } component.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickSelectTarget); } } }); } }
private void OnClickSelectTarget(GameObject go) { TeamTargetItem component = go.GetComponent <TeamTargetItem>(); if (component == this.lastSelectTargetItem) { return; } if (this.lastSelectTargetItem != null) { this.lastSelectTargetItem.Selected = false; } if (component != null) { component.Selected = true; } this.lastSelectTargetItem = component; this.SetTeamLevelLimit(); this.SetActivityOpenTime(); }