Skip to content

Commit e51e38a

Browse files
committed
support web builds on Unity 6 #103
1 parent 6f40765 commit e51e38a

File tree

5 files changed

+53
-11
lines changed

5 files changed

+53
-11
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Licensed under the MIT License. See LICENSE in the project root for license information.
2+
// Authored originally by Stephen Hodgson
3+
(function () { // wrap the method insertion in a function to avoid polluting global scope
4+
/**
5+
* Initializes the dynCall_* function table lookups.
6+
* Thanks to @De-Panther for the following code snippet.
7+
* Checks if specific dynCall functions exist,
8+
* if not, it will create them using the getWasmTableEntry function.
9+
* @see https://discussions.unity.com/t/makedyncall-replacing-dyncall-in-unity-6/1543088
10+
*/
11+
if (Module["ENVIRONMENT_IS_PTHREAD"]) {
12+
// If we are in a pthread, we need to initialize the dynCalls immediately
13+
initDynCalls();
14+
} else {
15+
Module['preRun'].push(function () {
16+
initDynCalls();
17+
});
18+
}
19+
20+
function initDynCalls() {
21+
if (typeof getWasmTableEntry !== "undefined") {
22+
Module.dynCall_vi = Module.dynCall_vi || function (cb, arg1) {
23+
return getWasmTableEntry(cb)(arg1);
24+
}
25+
Module.dynCall_vii = Module.dynCall_vii || function (cb, arg1, arg2) {
26+
return getWasmTableEntry(cb)(arg1, arg2);
27+
}
28+
Module.dynCall_viii = Module.dynCall_viii || function (cb, arg1, arg2, arg3) {
29+
return getWasmTableEntry(cb)(arg1, arg2, arg3);
30+
}
31+
Module.dynCall_viiii = Module.dynCall_viiii || function (cb, arg1, arg2, arg3, arg4) {
32+
return getWasmTableEntry(cb)(arg1, arg2, arg3, arg4);
33+
}
34+
}
35+
}
36+
})();

NativeWebSocket/Assets/WebSocket/WebSocket.jspre.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NativeWebSocket/Assets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.endel.nativewebsocket",
3-
"version": "1.1.5",
3+
"version": "1.1.6",
44
"description": "WebSocket client for Unity - with no external dependencies (WebGL, Native, Android, iOS, UWP).",
55
"license": "Apache 2.0",
66
"repository": {

NativeWebSocket/Packages/manifest.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
22
"dependencies": {
3-
"com.unity.collab-proxy": "1.15.7",
4-
"com.unity.ext.nunit": "1.0.6",
5-
"com.unity.ide.rider": "3.0.9",
6-
"com.unity.ide.visualstudio": "2.0.14",
3+
"com.unity.ai.navigation": "2.0.9",
4+
"com.unity.collab-proxy": "2.11.2",
5+
"com.unity.ext.nunit": "2.0.5",
6+
"com.unity.ide.rider": "3.0.38",
7+
"com.unity.ide.visualstudio": "2.0.26",
78
"com.unity.ide.vscode": "1.2.4",
8-
"com.unity.test-framework": "1.1.29",
9-
"com.unity.textmeshpro": "3.0.6",
10-
"com.unity.timeline": "1.6.3",
11-
"com.unity.ugui": "1.0.0",
9+
"com.unity.multiplayer.center": "1.0.1",
10+
"com.unity.test-framework": "1.6.0",
11+
"com.unity.timeline": "1.8.10",
12+
"com.unity.ugui": "2.0.0",
13+
"com.unity.modules.accessibility": "1.0.0",
14+
"com.unity.modules.adaptiveperformance": "1.0.0",
1215
"com.unity.modules.ai": "1.0.0",
1316
"com.unity.modules.androidjni": "1.0.0",
1417
"com.unity.modules.animation": "1.0.0",
@@ -35,6 +38,7 @@
3538
"com.unity.modules.unitywebrequestaudio": "1.0.0",
3639
"com.unity.modules.unitywebrequesttexture": "1.0.0",
3740
"com.unity.modules.unitywebrequestwww": "1.0.0",
41+
"com.unity.modules.vectorgraphics": "1.0.0",
3842
"com.unity.modules.vehicles": "1.0.0",
3943
"com.unity.modules.video": "1.0.0",
4044
"com.unity.modules.vr": "1.0.0",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2021.2.11f1
2-
m_EditorVersionWithRevision: 2021.2.11f1 (e50cafbb4399)
1+
m_EditorVersion: 6000.3.6f1
2+
m_EditorVersionWithRevision: 6000.3.6f1 (bbb010bdb8a3)

0 commit comments

Comments
 (0)