现版本
This commit is contained in:
@@ -302,6 +302,66 @@ export class EngineManager extends BaseManager {
|
||||
return this.engineInstance.jumpToCamera(cameraData);
|
||||
}
|
||||
|
||||
public getConstructTreeData(): { level: any[]; type: any[]; major: any[] } {
|
||||
if (!this.engineInstance) {
|
||||
console.warn('[EngineManager] 3D Engine not initialized.');
|
||||
return { level: [], type: [], major: [] };
|
||||
}
|
||||
return {
|
||||
level: this.engineInstance.getLevelTreeData(),
|
||||
type: this.engineInstance.getTypeTreeData(),
|
||||
major: this.engineInstance.getMajorTreeData(),
|
||||
};
|
||||
}
|
||||
|
||||
public getComponentProperties(url: string, id: string, callback: (data: any) => void): void {
|
||||
if (!this.engineInstance) {
|
||||
console.warn('[EngineManager] 3D Engine not initialized.');
|
||||
return;
|
||||
}
|
||||
this.engineInstance.getComponentProperties(url, id, callback);
|
||||
}
|
||||
|
||||
public registerRightKeyHandler(handler: (e: MouseEvent) => MenuItemConfig[] | null): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.registerHandler(handler);
|
||||
}
|
||||
|
||||
public unregisterRightKeyHandler(handler: (e: MouseEvent) => MenuItemConfig[] | null): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.unregisterHandler(handler);
|
||||
}
|
||||
|
||||
public clearRightKeyHandlers(keepDefault: boolean = true): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.clearHandlers(keepDefault);
|
||||
}
|
||||
|
||||
public showRightKeyMenu(x: number, y: number, items: MenuItemConfig[], groupOrder?: string[]): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.showMenu(x, y, items, groupOrder);
|
||||
}
|
||||
|
||||
public hideRightKeyMenu(): void {
|
||||
if (!this.rightKey) {
|
||||
console.warn('[EngineManager] RightKey manager not initialized.');
|
||||
return;
|
||||
}
|
||||
this.rightKey.hide();
|
||||
}
|
||||
|
||||
/** 销毁引擎管理器 */
|
||||
public destroy(): void {
|
||||
if (this.engineInstance) {
|
||||
|
||||
Reference in New Issue
Block a user