// Update is called once per frame
 void Update()
 {
     if (clientHandler.isConnected())
     {
         GetComponent <Text>().text = "Disconnect";
     }
     else
     {
         GetComponent <Text>().text = "Connect";
     }
 }
Exemplo n.º 2
0
 public void TryConnect()
 {
     clientHandler.hostName = stringToEdit;
     clientHandler.port     = Int32.Parse(port);
     if (clientHandler.isConnected())
     {
         clientHandler.Disconnect();
     }
     else
     {
         clientHandler.ConnectToServer();
         //gameObject.SetActive(false);
     }
 }