socket.io-unity icon indicating copy to clipboard operation
socket.io-unity copied to clipboard

Work with WebGL?

Open Zeon8 opened this issue 6 years ago • 1 comments

It work in editor, but when i build WebGL not work no errors no warnings no connecting logs

Zeon8 avatar May 24 '19 15:05 Zeon8

You need to use some workaround. It's no problem with this plugin, but the way unity builds WebGL.

Check this link: https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html

Basically, when you build your WebGL app, inside that index.html add socketi.io client (you can use from their website). And from c# call function in the browser (make some foo() function) that will init stuff like wich events to call from javascript to c#).

Inside c# just remap functionality to use external DLL import (you don't need socket.io plugin inside unity).

Sadly I don't have an example to show as I did this for the company.

PredragSilj98 avatar Jun 18 '20 05:06 PredragSilj98