/// <summary> /// 是否有角色 /// </summary> /// <returns>返回Bool</returns> private bool HaveCharacter() { ServerInfoVO serverInfo = m_ServerListProxy.GetLastLoginServer(); if (serverInfo.CharacterList?.Count > 0) { return(true); } else { return(false); } }
public override void OnRefresh(object msg) { UIManager.Instance.OpenPanel(UIPanel.CharacterModelPanel, m_PanelRoot); ServerInfoVO serverInfo = m_ServerListProxy.GetLastLoginServer(); if (serverInfo.CharacterList?.Count > 0) { m_ServerListProxy.SetCurrentState(CharacterPanelState.RoleList); } else { m_ServerListProxy.SetCurrentState(CharacterPanelState.CreatRole); } }
/// <summary> /// 刷新界面 /// </summary> public void RefreshViewByLabel() { m_SelectedServerID = m_ServerListProxy.GetSelectedServer()?.Gid ?? m_ServerListProxy.GetLastLoginServer()?.Gid ?? ""; List <object> datas = new List <object>(); int index = 0; for (int i = 0; i < m_ServerListProxy.GetServerList().Count; i++) { datas.Add(m_ServerListProxy.GetServerList()[i]); if (m_ServerListProxy.GetServerList()[i].Gid == m_SelectedServerID) { m_Parent.m_CurrentServerNameText.text = m_ServerListProxy.GetServerList()[i].Name; m_Parent.m_CurrentServerStateText.text = m_ServerListProxy.GetServerList()[i].State.ToString(); index = i; } } ClearData(); SetSortEnabled(false); AddDatas(null, datas); SetPageAndSelection(0, m_ServerListProxy.GetServerList()[index]); }