This commit is contained in:
2026-03-11 11:56:46 +08:00
parent ae59fbe68b
commit 7fdbf19951
9 changed files with 613 additions and 12 deletions

View File

@ -11,6 +11,7 @@ import { AppEnv } from './AppEnv';
import { AppModel } from './AppModel';
import { AppConfig } from './AppConfig';
import { AppRay } from './AppRay';
import { GameManager } from './GameManager';
import { EventBridge } from '../event/bridge';
/**
@ -25,6 +26,7 @@ export class MainApp {
appLight: AppLight;
appEnv: AppEnv;
appRay: AppRay;
gameManager: GameManager;
constructor() {
@ -35,6 +37,7 @@ export class MainApp {
this.appLight = new AppLight(this);
this.appEnv = new AppEnv(this);
this.appRay = new AppRay(this);
this.gameManager = new GameManager(this);
window.addEventListener("resize", () => this.appEngin.handleResize());
}
@ -44,13 +47,15 @@ export class MainApp {
* @param config 配置对象
*/
loadAConfig(config: any): void {
AppConfig.container = config.container ;
AppConfig.container = config.container;
AppConfig.modelUrlList = config.modelUrlList || [];
AppConfig.env = config.env;
}
loadModel(): void {
this.appModel.loadModel();
async loadModel(): Promise<void> {
await this.appModel.loadModel();
await this.gameManager.Awake();
EventBridge.allReady({ scene: this.appScene.object });
}
/** 唤醒/初始化所有子模块 */