[LayaAir 2.0]Laya2.2问题,有没有遇到的?
子域所有代码
(function () {
'use strict';
class GameConfig {
constructor() { }
static init() {
var reg = Laya.ClassUtils.regClass;
}
}
GameConfig.width = 640;
GameConfig.height = 1136;
GameConfig.scaleMode = "fixedwidth";
GameConfig.screenMode = "none";
GameConfig.alignV = "top";
GameConfig.alignH = "left";
GameConfig.startScene = "";
GameConfig.sceneRoot = "";
GameConfig.debug = false;
GameConfig.stat = false;
GameConfig.physicsDebug = false;
GameConfig.exportSceneToJson = true;
GameConfig.init();
class Main {
constructor() {
Laya.isWXOpenDataContext = true;
Laya.isWXPosMsg = true;
if (window["Laya3D"])
Laya3D.init(GameConfig.width, GameConfig.height);
else
Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
//只要初始化就报错
Laya["Physics"] && Laya["Physics"].enable();
Laya["DebugPanel"] && Laya["DebugPanel"].enable();
Laya.stage.scaleMode = GameConfig.scaleMode;
Laya.stage.screenMode = GameConfig.screenMode;
Laya.stage.alignV = GameConfig.alignV;
Laya.stage.alignH = GameConfig.alignH;
Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
Laya.enableDebugPanel();
if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
Laya["PhysicsDebugDraw"].enable();
if (GameConfig.stat)
Laya.Stat.show();
Laya.alertGlobalError = true;
this.onConfigLoaded();
}
onVersionLoaded() {
}
onConfigLoaded() {
console.log(123131313213);
}
}
new Main();
}());
错误信息:
Uncaught TypeError: window.wx.getFileSystemManager is not a function
at window.wxMiniGame (laya.wxmini.js:271)
at Function.__init__ (laya.core.js:7001)
at Object.init (laya.core.js:22020)
at new Main (bundle.js:31)
at bundle.js:54
at bundle.js:56
at require (WAGameSubContext.js:1)
at WAGameSubContext.js:1
at index.js:7
at require (WAGameSubContext.js:1)
(function () {
'use strict';
class GameConfig {
constructor() { }
static init() {
var reg = Laya.ClassUtils.regClass;
}
}
GameConfig.width = 640;
GameConfig.height = 1136;
GameConfig.scaleMode = "fixedwidth";
GameConfig.screenMode = "none";
GameConfig.alignV = "top";
GameConfig.alignH = "left";
GameConfig.startScene = "";
GameConfig.sceneRoot = "";
GameConfig.debug = false;
GameConfig.stat = false;
GameConfig.physicsDebug = false;
GameConfig.exportSceneToJson = true;
GameConfig.init();
class Main {
constructor() {
Laya.isWXOpenDataContext = true;
Laya.isWXPosMsg = true;
if (window["Laya3D"])
Laya3D.init(GameConfig.width, GameConfig.height);
else
Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
//只要初始化就报错
Laya["Physics"] && Laya["Physics"].enable();
Laya["DebugPanel"] && Laya["DebugPanel"].enable();
Laya.stage.scaleMode = GameConfig.scaleMode;
Laya.stage.screenMode = GameConfig.screenMode;
Laya.stage.alignV = GameConfig.alignV;
Laya.stage.alignH = GameConfig.alignH;
Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
Laya.enableDebugPanel();
if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
Laya["PhysicsDebugDraw"].enable();
if (GameConfig.stat)
Laya.Stat.show();
Laya.alertGlobalError = true;
this.onConfigLoaded();
}
onVersionLoaded() {
}
onConfigLoaded() {
console.log(123131313213);
}
}
new Main();
}());
错误信息:
Uncaught TypeError: window.wx.getFileSystemManager is not a function
at window.wxMiniGame (laya.wxmini.js:271)
at Function.__init__ (laya.core.js:7001)
at Object.init (laya.core.js:22020)
at new Main (bundle.js:31)
at bundle.js:54
at bundle.js:56
at require (WAGameSubContext.js:1)
at WAGameSubContext.js:1
at index.js:7
at require (WAGameSubContext.js:1)
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复