|
|
|
@ -14,6 +14,7 @@ import {
|
|
|
|
|
Image, |
|
|
|
|
Rectangle, |
|
|
|
|
} from '@babylonjs/gui'; |
|
|
|
|
import { config } from 'rxjs'; |
|
|
|
|
import { PlanComponent } from 'src/app/pages/plan/plan.component'; |
|
|
|
|
import { ConfigManager } from '../../controller/config-manager'; |
|
|
|
|
import { DataManager, ModelChangeType } from '../../controller/data-manager'; |
|
|
|
@ -61,7 +62,7 @@ export class FacilityWindow extends UIBase {
|
|
|
|
|
static readonly c_createIcon_width = 40; |
|
|
|
|
|
|
|
|
|
createIndex = 0; //临时的创建序号
|
|
|
|
|
indexDBInit: boolean = false; //是否完成了indexDB的初始化
|
|
|
|
|
// indexDBInit: boolean = false; //是否完成了indexDB的初始化
|
|
|
|
|
|
|
|
|
|
onInit() { |
|
|
|
|
FacilityWindow.instance = this; |
|
|
|
@ -167,17 +168,18 @@ export class FacilityWindow extends UIBase {
|
|
|
|
|
|
|
|
|
|
let instance = this; |
|
|
|
|
//为了避免多个模型同时加载、导致indexDB创建冲突,所以先加载一个,保证indexDB创建完成
|
|
|
|
|
if (!instance.indexDBInit) { |
|
|
|
|
BabylonTool.importMeshSync(null, "mesh/indexdb/gd/", "GD.gltf", undefined, "GD_indexDB", (meshes) => { |
|
|
|
|
meshes[0].dispose(); |
|
|
|
|
instance.indexDBInit = true; |
|
|
|
|
instance.updateFacilitieUIItems(facilities); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
instance.updateFacilitieUIItems(facilities); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (!instance.indexDBInit) {
|
|
|
|
|
// BabylonTool.importMeshSync(null, "mesh/indexdb/gd/", "GD.gltf", undefined, "GD_indexDB", (meshes) => {
|
|
|
|
|
// meshes[0].dispose();
|
|
|
|
|
// instance.indexDBInit = true;
|
|
|
|
|
// instance.updateFacilitieUIItems(facilities);
|
|
|
|
|
// console.log("加载完IndexDB");
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// instance.updateFacilitieUIItems(facilities);
|
|
|
|
|
// }
|
|
|
|
|
instance.updateFacilitieUIItems(facilities); |
|
|
|
|
instance.three = PlanComponent.instance |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|