web3dlink 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/web3dlink.es.js +18 -7
- package/web3dlink.umd.js +2 -2
package/package.json
CHANGED
package/web3dlink.es.js
CHANGED
|
@@ -624,6 +624,13 @@ function config(g) {
|
|
|
624
624
|
value: g.y_AroundSpeed,
|
|
625
625
|
defaultValue: 3,
|
|
626
626
|
min: 0
|
|
627
|
+
})), m.push(...validateOptionalNumber({
|
|
628
|
+
normalized: u,
|
|
629
|
+
field: "fov",
|
|
630
|
+
value: g.fov,
|
|
631
|
+
defaultValue: 90,
|
|
632
|
+
min: 1,
|
|
633
|
+
max: 179
|
|
627
634
|
})), {
|
|
628
635
|
errors: m,
|
|
629
636
|
normalized: u
|
|
@@ -18974,17 +18981,13 @@ class LoadStream {
|
|
|
18974
18981
|
log("数据通道已连通", c);
|
|
18975
18982
|
}));
|
|
18976
18983
|
let S = !0;
|
|
18977
|
-
|
|
18984
|
+
return b.on("datachanneltext", (c) => {
|
|
18978
18985
|
S && (S = !1, u.onSceneInitialized ? u.onSceneInitialized(c) : log("场景初始化加载成功", c)), u.onDatachanneltext ? u.onDatachanneltext(c) : log("接收数据", c);
|
|
18979
18986
|
}), b.on("error", u.onError || ((c) => {
|
|
18980
18987
|
console.error(c.message);
|
|
18981
18988
|
})), b.on("info", u.onInfo || ((c) => {
|
|
18982
18989
|
log("LarkSRClientEvent info", c);
|
|
18983
|
-
})), await b.connect({ appliId: m.appliId }), u.onConnected && u.onConnected(b), A.init(b), b.audioElement && (b.audioElement.volume = 0),
|
|
18984
|
-
const c = b.screenState.syncClientViewport.width, f = b.screenState.syncClientViewport.height;
|
|
18985
|
-
b == null || b.setCloudAppSize(c, f), console.log("resize", c, f);
|
|
18986
|
-
}
|
|
18987
|
-
return A._gameApi;
|
|
18990
|
+
})), await b.connect({ appliId: m.appliId }), u.onConnected && u.onConnected(b), A.init(b), b.audioElement && (b.audioElement.volume = 0), A._gameApi;
|
|
18988
18991
|
}
|
|
18989
18992
|
// 初始化插件
|
|
18990
18993
|
init(m) {
|
|
@@ -19005,13 +19008,21 @@ class LoadStream {
|
|
|
19005
19008
|
}
|
|
19006
19009
|
this._gameApi = null, this._larksr = null;
|
|
19007
19010
|
}
|
|
19011
|
+
// 新增获取 larksr 实例的方法
|
|
19012
|
+
getLarkSR() {
|
|
19013
|
+
return this._larksr;
|
|
19014
|
+
}
|
|
19008
19015
|
}
|
|
19009
19016
|
const loadStream = new LoadStream(), createAndInitLarkSR = loadStream.constructor.createAndInitLarkSR;
|
|
19010
19017
|
function closeGameApi() {
|
|
19011
19018
|
return loadStream.close();
|
|
19012
19019
|
}
|
|
19020
|
+
function getLarkSR() {
|
|
19021
|
+
return loadStream.getLarkSR();
|
|
19022
|
+
}
|
|
19013
19023
|
export {
|
|
19014
19024
|
closeGameApi,
|
|
19015
19025
|
createAndInitLarkSR,
|
|
19016
|
-
loadStream as default
|
|
19026
|
+
loadStream as default,
|
|
19027
|
+
getLarkSR
|
|
19017
19028
|
};
|