Exemplo n.º 1
0
    public void AddClient()
    {
        ClientObjectUI client;

        if (_clientUiPool.Count > 0)
        {
            client = _clientUiPool.Dequeue();
        }
        else
        {
            client = Instantiate(_clientPrefab, _contents).AddComponent <ClientObjectUI>();
        }

        client.socket = readyQueue.Dequeue();
        client.Init();
        client.localIp.text    = client.socket.LocalEndPoint.ToString();
        client.remoteIp.text   = client.socket.RemoteEndPoint.ToString();
        client.connection.text = "0";
        client.gameObject.SetActive(true);
        remote.AddClient(client);
    }