public void InitPartnerList(int test) { RoleInfo role_info = LobbyClient.Instance.CurrentRole; if (role_info != null) { PartnerStateInfo state_info = role_info.PartnerStateInfo; if (state_info == null) { return; } int active_id = state_info.GetActivePartnerId(); List <PartnerInfo> partnerList = state_info.GetAllPartners(); if (partnerList != null) { for (int index = 0; index < partnerList.Count; ++index) { //AddExitPartnerItem(partnerList[index],active_id); } int firstPartnerId = PartnerReposition(active_id); UIPartnerPanel partnerPanel = NGUITools.FindInParents <UIPartnerPanel>(this.gameObject); if (partnerPanel != null) { partnerPanel.SetPartnerInfo(firstPartnerId); } } } }
void OnClick() { if (m_IsPartnerFrag) { //todo:为伙伴灵魂石时,点击响应还待商讨 if (m_CanCompoundPartner) { LogicSystem.PublishLogicEvent("ge_compound_partner", "partner", m_PartnerId); } else { LogicSystem.EventChannelForGfx.Publish("ge_item_come_from", "ui", m_PartnerFragId); } } else { UIPartnerPanel partnerPanel = NGUITools.FindInParents <UIPartnerPanel>(gameObject); if (partnerPanel != null) { partnerPanel.SetPartnerInfo(m_PartnerId); } if (spSelectFlag != null) { NGUITools.SetActive(spSelectFlag.gameObject, true); } } }
//初始化伙伴列表 public void InitPartnerList() { RoleInfo role_info = LobbyClient.Instance.CurrentRole; if (role_info == null || role_info.PartnerStateInfo == null) { return; } List <PartnerConfig> partnerCfgList = PartnerConfigProvider.Instance.GetAllData(); int active_id = role_info.PartnerStateInfo.GetActivePartnerId(); int havenAddedPartnerCount = 0; for (int index = 0; index < partnerCfgList.Count; ++index) { if (partnerCfgList[index] != null) { int partnerId = partnerCfgList[index].Id; if (role_info.PartnerStateInfo.IsHavePartner(partnerId)) { PartnerInfo info = role_info.PartnerStateInfo.GetPartnerInfoById(partnerId); if (AddExitPartnerItem(info, active_id, havenAddedPartnerCount)) { havenAddedPartnerCount++; } } else { if (AddNotHavenPartnerItem(partnerCfgList[index], havenAddedPartnerCount)) { havenAddedPartnerCount++; } } } } int firstPartnerId = PartnerReposition(active_id); UIScrollView scrollview = NGUITools.FindInParents <UIScrollView>(goItemContainer); if (scrollview != null) { scrollview.ResetPosition(); } UIPartnerPanel partnerPanel = NGUITools.FindInParents <UIPartnerPanel>(this.gameObject); if (partnerPanel != null) { partnerPanel.SetPartnerInfo(firstPartnerId); } }