1
This commit is contained in:
@ -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 });
|
||||
}
|
||||
|
||||
/** 唤醒/初始化所有子模块 */
|
||||
|
||||
Reference in New Issue
Block a user