void EstablishNewConnection()
 {
     if (client != null)
     {
         Destroy(client.gameObject);
     }
     client = Instantiate(clientPrefab);
     client.OnMessageReceived = OnMessageReceived;
     client.OnDesconnected    = OnDesconnected;
     client.OnSubscribe       = OnSubscribe;
     client.Connect();
 }
Beispiel #2
0
        public void Connect(string player_Id, bool forceNewConnect = false)
        {
            if (!isConnected || forceNewConnect)
            {
                playerId = player_Id;

                client.Connect();
            }
            else
            {
                print("already Connected");
            }
        }