Closed DaylightNebula closed 2 years ago
Did you manage to fix this, and if so, how?
If anyone still encounters this, it is because DispatchMessageQueue
does not have a matching JavaScript definition when building for WebGL. The websocket.SendText
, websocket.SendData
, etc. functions are sufficient in JS when building for WebGL. They don't need to be dispatched, unlike when building for the Unity Editor.
That is why the examples have the compiler flags !UNITY_WEBGL || UNITY_EDITOR
When I try to run a WebGL build I get the following error:
Assets\Scripts\Behavior\BehaviorClient.cs(102,16): error CS1061: 'WebSocket' does not contain a definition for 'DispatchMessageQueue' and no accessible extension method 'DispatchMessageQueue' accepting a first argument of type 'WebSocket' could be found (are you missing a using directive or an assembly reference?)
I am running Unity 2021.3.5f1