This commit is contained in:
2026-04-24 19:17:31 +08:00
parent 6c94559383
commit 01fdc0ee37
18 changed files with 696 additions and 196 deletions

View File

@ -14,6 +14,7 @@ import { AppRay } from './AppRay';
import { GameManager } from './GameManager';
import { EventBridge } from '../event/bridge';
import { AppHotspot } from './AppHotspot';
import { AppDomTo3D } from './AppDomTo3D';
/**
* 主应用类 - 3D场景的核心控制器
@ -28,6 +29,7 @@ export class MainApp {
appEnv: AppEnv;
appRay: AppRay;
appHotspot: AppHotspot;
appDomTo3D: AppDomTo3D;
gameManager: GameManager;
@ -40,6 +42,7 @@ export class MainApp {
this.appEnv = new AppEnv(this);
this.appRay = new AppRay(this);
this.appHotspot = new AppHotspot(this);
this.appDomTo3D = new AppDomTo3D(this);
this.gameManager = new GameManager(this);
window.addEventListener("resize", () => this.appEngin.handleResize());
@ -58,6 +61,7 @@ export class MainApp {
async loadModel(): Promise<void> {
await this.appModel.loadModel();
await this.gameManager.Awake();
console.log(1111111111111111111111);
EventBridge.allReady({ scene: this.appScene.object });
}
@ -68,7 +72,8 @@ export class MainApp {
this.appCamera.Awake();
this.appLight.Awake();
this.appEnv.Awake();
this.appRay.Awake()
this.appRay.Awake();
this.appDomTo3D.init();
this.appModel.initManagers();
this.update();
EventBridge.sceneReady({ scene: this.appScene.object });
@ -80,6 +85,7 @@ export class MainApp {
this.appEngin.object.runRenderLoop(() => {
this.appScene.object?.render();
this.appCamera.update();
this.appDomTo3D.updateDomPositions();
});
}