예제 #1
0
        public void Join()
        {
            MatchStarter starter = FindObjectOfType <MatchStarter>();

            if (starter)
            {
                starter.JoinOnlineGame(endpoint);
            }
            else
            {
                Debug.LogError("No match starter found");
            }
        }
예제 #2
0
        public void Connect()
        {
            portOutput.text = "";

            int port;

            if (int.TryParse(portInput.text, out port))
            {
                if (port >= LOWEST_PORT_NUM && port <= HIGHEST_PORT_NUM)
                {
                    //Success, start the server
                    MatchStarter matchStarter = FindObjectOfType <MatchStarter>();
                    matchStarter.JoinOnlineGame(ipInput.text, port);
                }
                else
                {
                    portOutput.text = "Port number must be between " + LOWEST_PORT_NUM + " and " + HIGHEST_PORT_NUM + ".";
                }
            }
            else
            {
                portOutput.text = "Port must be a number!";
            }
        }