Exemplo n.º 1
0
    public void Button()
    {
        string    portString = portInput.text;
        string    ipString   = ipInput.text;
        int       port;
        IPAddress ip;

        if (portString == string.Empty && ipString == string.Empty)
        {
            port = 7777;
            ip   = NetworkComponent.GetLocalIPAddress();
        }
        else
        {
            if (!int.TryParse(portString, out port))
            {
                Debug.LogWarning("portti meni vituix");
                return;
            }

            if (!IPAddress.TryParse(ipString, out ip))
            {
                Debug.LogWarning("ip meni vituix");
                return;
            }
        }

        client.StartClient(ip, port);
    }