コード例 #1
0
        public void UpdateState(ENetClient client)
        {
            UpdateStateInfoText(client);
            bool connected = client != null && client.IsConnected;

            sendMessageButton.interactable = connected;
            disconnectButton.interactable  = connected;
            udpConnectButton.interactable  = !connected;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 private void Start()
 {
     client = new ENetClient();
 }