We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa05873 commit 638fb81Copy full SHA for 638fb81
1 file changed
Transports/com.community.netcode.transport.websocket/Runtime/WebSocketClientFactory.cs
@@ -10,8 +10,8 @@ namespace Netcode.Transports.WebSocket
10
{
11
public class WebSocketClientFactory
12
13
-#if UNITY_WEBGL
14
- public static JSWebSocketClient Client = new JSWebSocketClient();
+#if (UNITY_WEBGL && !UNITY_EDITOR)
+ public static JSWebSocketClient Client;
15
16
internal delegate void OnOpenCallback();
17
internal delegate void OnMessageCallback(IntPtr messagePointer, int messageSize);
@@ -67,7 +67,8 @@ internal static void OnCloseEvent(int disconnectCode)
67
68
public static IWebSocketClient Create(string url)
69
70
71
+ Client = new JSWebSocketClient()
72
_SetUrl(url);
73
_SetOnOpen(OnOpenEvent);
74
_SetOnMessage(OnMessageEvent);
0 commit comments