Auycro

Implement WebSocket to Unity WebGL via Javascript Plugin#1

02 Sep 2015

This guide will introduce you how to implement Unity’s WebGL with WebSocket.

Part1

Prepare Javascript plugin function

First we will prepare the WebSocket library in javascript.
Here is my Javascript plugin for WebSocket, "WebSocket.jslib".

As you can see, we already have 5 functions (Hello,InitWebSocket,Send,State,Close) to use in Unity.
In the next part, I will show you how to create GameObject and Script.

Go Part2

Reference: webgl-interactingwithbrowserscripting WebSocket-echo WebSocket