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); } } } }
// public void UpdatePartnerInfo(PartnerInfo info) { if (info == null) { return; } UIPartnerItem partner_item = GetPartnerItemById(info.Id); if (partner_item != null) { partner_item.UpdatePartnerInfo(info); } 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(); PartnerReposition(active_id); } }
void OnEnable() { try { 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(); PartnerReposition(active_id); } } catch (System.Exception ex) { ArkCrossEngine.LogicSystem.LogErrorFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }