File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ namespace Netcode.Transports.WebSocket
10
10
{
11
11
public class WebSocketClientFactory
12
12
{
13
- #if UNITY_WEBGL
14
- public static JSWebSocketClient Client = new JSWebSocketClient ( ) ;
13
+ #if ( UNITY_WEBGL && ! UNITY_EDITOR )
14
+ public static JSWebSocketClient Client ;
15
15
16
16
internal delegate void OnOpenCallback ( ) ;
17
17
internal delegate void OnMessageCallback ( IntPtr messagePointer , int messageSize ) ;
@@ -67,7 +67,8 @@ internal static void OnCloseEvent(int disconnectCode)
67
67
68
68
public static IWebSocketClient Create ( string url )
69
69
{
70
- #if UNITY_WEBGL
70
+ #if ( UNITY_WEBGL && ! UNITY_EDITOR )
71
+ Client = new JSWebSocketClient ( )
71
72
_SetUrl( url ) ;
72
73
_SetOnOpen ( OnOpenEvent ) ;
73
74
_SetOnMessage ( OnMessageEvent ) ;
You can’t perform that action at this time.
0 commit comments