示例#1
0
        public void Awake()
        {
            instance = this;

            if (serverIp == null)
            {
                this.isServer = true;
                connection    = new UdpConnectedClient();
            }
            else
            {
                connection = new UdpConnectedClient(ip: serverIp);
                AddClient(new IPEndPoint(serverIp, Globals.port));
            }
        }
示例#2
0
        public void Awake()
        {
            instance = this;
            username = MainSceneEventHandler.instance.usernameInput.text;

            if (serverIp == null)
            {
                this.isServer = true;
                connection    = new UdpConnectedClient();

                LobbyList.setPlayerName(username);
                LobbyList.setReadyStatement("N");
            }
            else
            {
                connection = new UdpConnectedClient(ip: serverIp);
                AddClient(new IPEndPoint(serverIp, Globals.port));
            }
        }