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
1010{
1111 public class WebSocketClientFactory
1212 {
13- #if UNITY_WEBGL
14- public static JSWebSocketClient Client = new JSWebSocketClient ( ) ;
13+ #if ( UNITY_WEBGL && ! UNITY_EDITOR )
14+ public static JSWebSocketClient Client ;
1515
1616 internal delegate void OnOpenCallback ( ) ;
1717 internal delegate void OnMessageCallback ( IntPtr messagePointer , int messageSize ) ;
@@ -67,7 +67,8 @@ internal static void OnCloseEvent(int disconnectCode)
6767
6868 public static IWebSocketClient Create ( string url )
6969 {
70- #if UNITY_WEBGL
70+ #if ( UNITY_WEBGL && ! UNITY_EDITOR )
71+ Client = new JSWebSocketClient ( )
7172 _SetUrl( url ) ;
7273 _SetOnOpen ( OnOpenEvent ) ;
7374 _SetOnMessage ( OnMessageEvent ) ;
You can’t perform that action at this time.
0 commit comments