Commit 4980dee1 authored by Master Q's avatar Master Q

适配淘宝环境处理

parent 09f8472b
......@@ -12,5 +12,6 @@ fs.writeFileSync(endPath + "output.js",
// 'import * as FYGE from "fyge";\n' +//以后改成这个
// 'import * as SvgaParser from "svga-parser";\n' +
'/* eslint-disable */\n' +
'const FYGE = require("./fyge.min.js");\n' +
fs.readFileSync("./output.js"));
console.log("js生成")
This diff is collapsed.
......@@ -169,18 +169,18 @@ export class GameScene extends Dream.RenderContainer {
* 绑定事件
*/
initEvents() {
if (GameConfig.debugger) {
if (GameConfig.debugger && document) {
document.body.addEventListener('keydown', (e) => {
if (e.code != "Space") return;
this.onActionDown();
})
}
this.sceneCont.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onActionDown, this)
this.sceneCont?.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onActionDown, this)
}
removeEvents() {
this.sceneCont.removeAllEventListener()
this.sceneCont?.removeAllEventListener()
}
/**
......@@ -201,7 +201,7 @@ export class GameScene extends Dream.RenderContainer {
console.log('最远距离了')
})
if (GameConfig.debugger) {
if (GameConfig.debugger && document) {
document.body.addEventListener('keyup', async () => {
this.onActionUp()
}, {once: true})
......
......@@ -63,7 +63,8 @@ export function sendTbNet(
//网络超时
// let waitObj;
//@ts-ignore 本地开发,直接取数据
if (location.port == '8081') {
console.log('send tbNet ===========')
if (location && location.port == '8081') {
const netInfo = netName.split(".");
const url = `../../mock/miniTb/${netInfo[0]}/${netInfo[1]}.json`;
fetchAsync(url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment