1
This commit is contained in:
@ -15,6 +15,8 @@ import { GameManager } from './GameManager';
|
||||
import { EventBridge } from '../event/bridge';
|
||||
import { AppHotspot } from './AppHotspot';
|
||||
import { AppDomTo3D } from './AppDomTo3D';
|
||||
import { AppSelectionOutline } from './AppSelectionOutline';
|
||||
import { AppPositionGizmo } from './AppPositionGizmo';
|
||||
|
||||
/**
|
||||
* 主应用类 - 3D场景的核心控制器
|
||||
@ -30,6 +32,8 @@ export class MainApp {
|
||||
appRay: AppRay;
|
||||
appHotspot: AppHotspot;
|
||||
appDomTo3D: AppDomTo3D;
|
||||
appSelectionOutline: AppSelectionOutline;
|
||||
appPositionGizmo: AppPositionGizmo;
|
||||
gameManager: GameManager;
|
||||
|
||||
|
||||
@ -43,6 +47,8 @@ export class MainApp {
|
||||
this.appRay = new AppRay(this);
|
||||
this.appHotspot = new AppHotspot(this);
|
||||
this.appDomTo3D = new AppDomTo3D(this);
|
||||
this.appSelectionOutline = new AppSelectionOutline(this);
|
||||
this.appPositionGizmo = new AppPositionGizmo(this);
|
||||
this.gameManager = new GameManager(this);
|
||||
|
||||
window.addEventListener("resize", () => this.appEngin.handleResize());
|
||||
@ -55,7 +61,11 @@ export class MainApp {
|
||||
loadAConfig(config: any): void {
|
||||
AppConfig.container = config.container;
|
||||
AppConfig.modelUrlList = config.modelUrlList || [];
|
||||
AppConfig.env = config.env;
|
||||
AppConfig.env = { ...AppConfig.env, ...(config.env || {}) };
|
||||
AppConfig.gizmo = { ...AppConfig.gizmo, ...(config.gizmo || {}) };
|
||||
AppConfig.outline = { ...AppConfig.outline, ...(config.outline || {}) };
|
||||
this.appPositionGizmo.configure(AppConfig.gizmo);
|
||||
this.appSelectionOutline.configure(AppConfig.outline);
|
||||
}
|
||||
|
||||
async loadModel(): Promise<void> {
|
||||
@ -73,6 +83,8 @@ export class MainApp {
|
||||
this.appLight.Awake();
|
||||
this.appEnv.Awake();
|
||||
this.appRay.Awake();
|
||||
this.appSelectionOutline.init();
|
||||
this.appPositionGizmo.Awake();
|
||||
this.appDomTo3D.init();
|
||||
this.appModel.initManagers();
|
||||
this.update();
|
||||
@ -93,6 +105,7 @@ export class MainApp {
|
||||
async dispose(): Promise<void> {
|
||||
this.appModel?.clean();
|
||||
this.appEnv?.clean();
|
||||
this.appPositionGizmo?.dispose();
|
||||
// this.appHotspot?.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user