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