//显示选中的server信息
 void ShowSelectServerInfo()
 {
     SelectServerData.ServerInfo info = SelectServerData.Instance.curSelectServer;
     mPlayNameLabel.text  = info.name;
     mPlayStateLabel.text = "(" + SelectServerData.Instance.StateString[(int)info.state] + ")";
     SelectServerData.Instance.SetLabelColor(mPlayStateLabel, info.state);
 }
示例#2
0
 void ShowDefaultServer(int type = 0)  // type = 0  show name,type = 1 show addr
 {
     SelectServerData.ServerInfo info = SelectServerData.Instance.curSelectServer;
     nameDefault.text  = (type == 0) ? info.name : info.addr;
     stateDefault.text = (type == 0) ? ("(" + SelectServerData.Instance.StateString[(int)info.state] + ")") : "";
     SetLabelColor(stateDefault, info.state);
     ShowSelectSprite(SelectServerData.Instance.curSelectIndex);
 }
示例#3
0
 void ShowAllServer(int type = 0)   // type = 0  show name,type = 1 show addr
 {
     for (int i = 0; i < nameList.Count; i++)
     {
         SelectServerData.ServerInfo info = SelectServerData.Instance.GetServerDicInfo().ElementAt(i).Value;
         nameList.ElementAt(i).text  = (type == 0) ? info.name : info.addr;
         stateList.ElementAt(i).text = (type == 0) ? ("(" + SelectServerData.Instance.StateString[(int)(info.state)] + ")") : "";
         SetLabelColor(stateList.ElementAt(i), info.state);
     }
 }
示例#4
0
        //开始游戏
        public void GamePlay()
        {
            int index = SelectServerData.Instance.curSelectIndex;

            SelectServerData.ServerInfo info = SelectServerData.Instance.GetServerDicInfo().ElementAt(index).Value;
            NetworkManager.Instance.canReconnect = false;
            NetworkManager.Instance.Close();
            NetworkManager.Instance.Init(info.addr, info.port, NetworkManager.ServerType.BalanceServer);
            PlayerPrefs.SetString(SelectServerData.serverKey, info.name);
        }