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