Feature/UI input system fix (#243)

* feat(ui): 实现编辑器预览模式下的 UI 输入系统

* feat(platform-web): 为浏览器运行时添加 UI 输入系统绑定
This commit is contained in:
YHH
2025-11-27 22:31:05 +08:00
committed by GitHub
parent b8f05b79b0
commit cabb625a17
8 changed files with 9589 additions and 7594 deletions

View File

@@ -21,8 +21,10 @@ class BrowserRuntime {
private animationId: number | null = null;
private assetManager: AssetManager;
private engineIntegration: EngineIntegration;
private canvasId: string;
constructor(config: RuntimeConfig) {
this.canvasId = config.canvasId;
if (!Core.Instance) {
Core.create();
}
@@ -58,8 +60,10 @@ class BrowserRuntime {
// 初始化模块系统
await initializeRuntime(Core);
// 创建运行时系统
this.systems = createRuntimeSystems(Core.scene!, this.bridge);
// 创建运行时系统(传入 canvasId 用于 UI 输入绑定)
this.systems = createRuntimeSystems(Core.scene!, this.bridge, {
canvasId: this.canvasId
});
}
async loadScene(sceneUrl: string): Promise<void> {