Ejemplo n.º 1
0
        public void ConnectClient(string address, int port, PeerDebug.Settings debugSettings = null)
        {
            if (server == null)
            {
                StatefulWorld.Instance.Initialize();
            }

            PeerDebug debug = null;

            if (debugSettings != null && server == null)
            {
                debug = gameObject.AddComponent <PeerDebug>();
                debug.Initialize(debugSettings);
            }

            client = new Peer(debug);
            client.Connect(address, port, server != null);

            if (server != null)
            {
                server.HasListenClient = true;
            }
        }