Skip to content

Commit 2b43ecc

Browse files
authored
jslib updated (#77)
1 parent fc82255 commit 2b43ecc

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

Runtime/Plugins/livekit-bridge.jslib

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@ var NativeLib = {
1111
NullPtr: 0,
1212

1313
DynCall: function (sig, fnc, args) {
14-
if (typeof Runtime !== 'undefined') {
15-
Runtime.dynCall(sig, fnc, args); // Old Unity version
16-
} else {
17-
dynCall(sig, fnc, args);
14+
if (typeof Runtime !== 'undefined' && typeof Runtime.dynCall === 'function') {
15+
return Runtime.dynCall(sig, fnc, args);
16+
}
17+
18+
if (sig === 'vi') {
19+
return ({{{ makeDynCall('vi', 'fnc') }}}).apply(null, args);
20+
}
21+
22+
var legacy = (typeof Module !== 'undefined') ? Module['dynCall_' + sig] : undefined;
23+
if (typeof legacy === 'function') {
24+
return legacy.apply(null, [fnc].concat(args));
25+
}
26+
27+
var table = (typeof Module !== 'undefined' && Module['wasmTable']) ? Module['wasmTable'] : (typeof wasmTable !== 'undefined' ? wasmTable : undefined);
28+
if (table && typeof table.get === 'function') {
29+
return table.get(fnc).apply(null, args);
1830
}
1931
},
2032

0 commit comments

Comments
 (0)