void EstablishNewConnection() { if (client != null) { Destroy(client.gameObject); } client = Instantiate(clientPrefab); client.OnMessageReceived = OnMessageReceived; client.OnDesconnected = OnDesconnected; client.OnSubscribe = OnSubscribe; client.Connect(); }
public void Connect(string player_Id, bool forceNewConnect = false) { if (!isConnected || forceNewConnect) { playerId = player_Id; client.Connect(); } else { print("already Connected"); } }