有很多原生 xxx.class.js文件, 主要是一些武器类.
代码如下:
// 武器注册类 import {db} from './db' class WUQIxxx{ constructor(){ this.name = "魔术法杖" // 名称 this.type = 10 this.group = 2 db.items[this.type] = this // 注册 } .... } new WUQIxxx()
// db数据类 class Db{ constructor(){ this.items = {} } } export const db = new Db();
请问: 如何在"游戏大厅"场景中不使用db.js 和 WUQIxxx.js. 而仅在"game"场景中加载上述js.