先移除wasm后续再通过其他方式接入

This commit is contained in:
YHH
2025-06-10 09:49:55 +08:00
parent e71c49d596
commit 7a591825eb
24 changed files with 40 additions and 2509 deletions

View File

@@ -189,32 +189,14 @@ export class Core {
* @param options - 额外的配置选项
* @returns Core实例
*/
public static create(debug: boolean = true, options?: { disableWasm?: boolean }): Core {
public static create(debug: boolean = true): Core {
if (this._instance == null) {
this._instance = new Core(debug);
// 如果指定禁用WASM设置静默模式
if (options?.disableWasm) {
this.disableWasm();
}
}
return this._instance;
}
/**
* 禁用WASM支持
*
* 当WASM加载失败或在不支持的环境中使用时调用。
* 这将使ECS系统使用JavaScript回退实现。
*/
public static disableWasm(): void {
// 动态导入WASM实例并设置为静默模式
import('./Utils/Wasm/instance').then(({ ecsCore }) => {
ecsCore.setSilent(true);
}).catch(() => {
// 如果导入失败,忽略错误
});
}
/**
* 注册全局管理器