public void UpdateState(ENetClient client) { UpdateStateInfoText(client); bool connected = client != null && client.IsConnected; sendMessageButton.interactable = connected; disconnectButton.interactable = connected; udpConnectButton.interactable = !connected; }
private void UpdateStateInfoText(ENetClient client) { if (client == null) { return; } var text = $"Server ip: {client.Address.GetHost()}, Server port: {client.Address.Port}\n" + $"IsConnected: {client.IsConnected}\n "; stateInfoText.text = text; }
private void Start() { client = new ENetClient(); }