From 57ae37ba1623ef2127402d6c657e7cf860b7ba32 Mon Sep 17 00:00:00 2001 From: liuxianghui <519646741@qq.com> Date: Wed, 10 Nov 2021 11:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=A0=E6=B2=B9=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/babylon/controller/data-manager.ts | 9 +- .../property-data/in/property-data-jyj.ts | 22 +++ .../property-data/in/property-data-sygx.ts | 25 +++ .../property-data/in/property-data-yg.ts | 20 +++ .../property-data/in/property-data-yqhsgx.ts | 25 +++ .../property-data/out/property-data-q.ts | 2 +- .../data/model-data/model-data-facility.ts | 2 +- .../model/facilityinfo-tool/facility-area.ts | 50 ++++-- .../model/info/model/model-info-facility.ts | 34 ++-- .../babylon/model/info/model/model-info.ts | 16 +- src/app/babylon/tool/pos-point-tool.ts | 7 +- .../view/facility-window/facility-window.ts | 147 ++++++++++++++++-- 12 files changed, 312 insertions(+), 47 deletions(-) create mode 100644 src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts create mode 100644 src/app/babylon/model/data/institution/facility/property-data/in/property-data-sygx.ts create mode 100644 src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts create mode 100644 src/app/babylon/model/data/institution/facility/property-data/in/property-data-yqhsgx.ts diff --git a/src/app/babylon/controller/data-manager.ts b/src/app/babylon/controller/data-manager.ts index 4b8f0c6..8d784f4 100644 --- a/src/app/babylon/controller/data-manager.ts +++ b/src/app/babylon/controller/data-manager.ts @@ -11,7 +11,11 @@ import { } from '../model/data/institution/building/building-data'; import { AllFacilityData } from '../model/data/institution/facility/all-facility-data'; import { PropertyData_Base_IMG } from '../model/data/institution/facility/property-data/base/property-data-base-img'; +import { PropertyData_JYJ } from '../model/data/institution/facility/property-data/in/property-data-jyj'; import { PropertyData_MHQ } from '../model/data/institution/facility/property-data/in/property-data-mhq'; +import { PropertyData_SYGX } from '../model/data/institution/facility/property-data/in/property-data-sygx'; +import { PropertyData_YG } from '../model/data/institution/facility/property-data/in/property-data-yg'; +import { PropertyData_YQHSGX } from '../model/data/institution/facility/property-data/in/property-data-yqhsgx'; import { PropertyData_DWBZ } from '../model/data/institution/facility/property-data/out/property-data-dwbz'; import { PropertyData_PL } from '../model/data/institution/facility/property-data/out/property-data-pl'; import { PropertyData_Q } from '../model/data/institution/facility/property-data/out/property-data-q'; @@ -439,7 +443,10 @@ export class DataManager { case FacilityType.XF_MHQ_GF_4: case FacilityType.XF_MHQ_GF_8: case FacilityType.XF_MHQ_GF_35: result = new PropertyData_MHQ(key, facilityType); break; - + case FacilityType.JY_JYJ: result = new PropertyData_JYJ(key); break; + case FacilityType.JY_YG: result = new PropertyData_YG(key); break; + case FacilityType.JY_SYGX: result = new PropertyData_SYGX(key); break; + case FacilityType.JY_YQHSGX: result = new PropertyData_YQHSGX(key); break; } diff --git a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts new file mode 100644 index 0000000..1455610 --- /dev/null +++ b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts @@ -0,0 +1,22 @@ + +import { FacilityType } from "../../../../model-data/model-data-facility"; +import { PropertyData_Base } from "../property-data-base"; + +/** + * 加油机 + */ +export class PropertyData_JYJ extends PropertyData_Base { + + + + constructor(key: string) { + super(key, FacilityType.JY_JYJ); + + } + + clone(key: string) { + let result = new PropertyData_JYJ(key); + return result; + } + +} \ No newline at end of file diff --git a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-sygx.ts b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-sygx.ts new file mode 100644 index 0000000..a396beb --- /dev/null +++ b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-sygx.ts @@ -0,0 +1,25 @@ + +import { FacilityType } from "../../../../model-data/model-data-facility"; +import { PropertyData_Base_IMG } from "../base/property-data-base-img"; +import { PropertyData_Base } from "../property-data-base"; + +/** + * 输油管 + */ +export class PropertyData_SYGX extends PropertyData_Base_IMG { + + constructor(key: string) { + super(key, "", "", "", FacilityType.JY_SYGX); + + } + + clone(key: string) { + let result = new PropertyData_SYGX(key); + result.img = this.img; + result.pos = this.pos; + result.info = this.info, + result.is360 = this.is360; + return result; + } + +} \ No newline at end of file diff --git a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts new file mode 100644 index 0000000..a495585 --- /dev/null +++ b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts @@ -0,0 +1,20 @@ + +import { FacilityType } from "../../../../model-data/model-data-facility"; +import { PropertyData_Base } from "../property-data-base"; + +/** + * 油罐 + */ +export class PropertyData_YG extends PropertyData_Base { + + constructor(key: string) { + super(key, FacilityType.JY_YG); + + } + + clone(key: string) { + let result = new PropertyData_YG(key); + return result; + } + +} \ No newline at end of file diff --git a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yqhsgx.ts b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yqhsgx.ts new file mode 100644 index 0000000..22bdab0 --- /dev/null +++ b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yqhsgx.ts @@ -0,0 +1,25 @@ + +import { FacilityType } from "../../../../model-data/model-data-facility"; +import { PropertyData_Base_IMG } from "../base/property-data-base-img"; +import { PropertyData_Base } from "../property-data-base"; + +/** + * 输油管 + */ +export class PropertyData_YQHSGX extends PropertyData_Base_IMG { + + constructor(key: string) { + super(key, "", "", "", FacilityType.JY_YQHSGX); + + } + + clone(key: string) { + let result = new PropertyData_YQHSGX(key); + result.img = this.img; + result.pos = this.pos; + result.info = this.info, + result.is360 = this.is360; + return result; + } + +} \ No newline at end of file diff --git a/src/app/babylon/model/data/institution/facility/property-data/out/property-data-q.ts b/src/app/babylon/model/data/institution/facility/property-data/out/property-data-q.ts index dbb01b2..67b507b 100644 --- a/src/app/babylon/model/data/institution/facility/property-data/out/property-data-q.ts +++ b/src/app/babylon/model/data/institution/facility/property-data/out/property-data-q.ts @@ -6,7 +6,7 @@ import { PropertyData_Base_IMG } from "../base/property-data-base-img"; import { PropertyData_Base } from "../property-data-base"; /** - * 集结区和禁停区 + * 区域类 */ export class PropertyData_Q extends PropertyData_Base_IMG { diff --git a/src/app/babylon/model/data/model-data/model-data-facility.ts b/src/app/babylon/model/data/model-data/model-data-facility.ts index 5fe89f2..aa080af 100644 --- a/src/app/babylon/model/data/model-data/model-data-facility.ts +++ b/src/app/babylon/model/data/model-data/model-data-facility.ts @@ -67,7 +67,7 @@ export class ModelData_facility extends ModelData { //新建区域位点 newAreapPoints(): Vector3[] { - let size = 10; + let size = 3; let x = 0.75 * size; let z = 0.5 * size; let result: Vector3[] = []; diff --git a/src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts b/src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts index 8531844..6c96074 100644 --- a/src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts +++ b/src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts @@ -1,6 +1,6 @@ //#region 区域 -import { AbstractMesh, Color3, Mesh, MeshBuilder, Observer, PolygonMeshBuilder, Quaternion, Scene, StandardMaterial, Vector2, Vector3 } from "@babylonjs/core"; +import { AbstractMesh, Color3, Mesh, MeshBuilder, Observer, PointerDragBehavior, PolygonMeshBuilder, Quaternion, Scene, StandardMaterial, Vector2, Vector3 } from "@babylonjs/core"; import { Button, Vector2WithInfo } from "@babylonjs/gui"; import { ModelInfo_facility } from "../model-info-facility"; @@ -197,9 +197,9 @@ export class AreaInfo { //更新顶点 updateMeshPoint(index = -1) { this.clearMeshPoint(); - let select = null; + let select: PolygonMeshPoint = null; for (let i = 0; i < this.pointData.length; i++) { - let l_meshPoint = new PolygonMeshPoint(PosPointTool.c_key + "_" + i, i, 0.2, this.root, this.pointData[i], this); + let l_meshPoint = new PolygonMeshPoint(PosPointTool.c_key + "_" + i, i, 0.5, this.root, this.pointData[i], this); this.pointMesh.push(l_meshPoint); if (i == index) { @@ -266,6 +266,7 @@ export class PolygonMeshPoint { area: AreaInfo mesh: Mesh; pos: Vector3; + pointMat: StandardMaterial; //顶点材质 index: number; @@ -273,6 +274,7 @@ export class PolygonMeshPoint { onGizmoAimMeshObservor: Observer; onPointerClickObservor: Observer; + pointerDragBehavior: PointerDragBehavior;//拖拽事件 constructor(name: string, index: number, size: number, parent: Mesh, pos: Vector3, area: AreaInfo) { @@ -289,23 +291,37 @@ export class PolygonMeshPoint { //初始化编辑UI initEditUI(name: string, size: number, parent: Mesh, pos: Vector3) { if (ModeManager.currentMode == ModeType.Edit) { - this.mesh = MeshBuilder.CreateBox(name, { size: size }); + let instance = this; + + this.mesh = MeshBuilder.CreateSphere(name, { diameter: size }); this.mesh.setParent(parent); this.mesh.position = pos; - this.mesh.isVisible = false; + this.mesh.isVisible = true; - let instance = this; - this.uiRoot = Button.CreateSimpleButton("ui_" + name, this.index.toString()); - UIManager.Instance.uiRoot.addControl(this.uiRoot); - this.uiRoot.linkWithMesh(this.mesh); - BabylonUIStyleTool.setStyle_size(this.uiRoot, "20px", "20px"); - this.uiRoot.background = BabylonUIStyleTool.c_color_blue; - this.uiRoot.color = BabylonUIStyleTool.c_color_white; - this.uiRoot.onPointerClickObservable.add(() => { + this.pointMat = new StandardMaterial("mat_areaPoint", SceneManager.Instance.scene); + this.pointMat.emissiveColor = Color3.FromHexString("#A9FF00"); + this.pointMat.disableLighting = true; + this.pointMat.alpha = 0.87; + this.mesh.material = this.pointMat; + + this.pointerDragBehavior = new PointerDragBehavior({ dragPlaneNormal: Vector3.Up() }); //平面内移动 + this.mesh.addBehavior(this.pointerDragBehavior); + this.pointerDragBehavior.onDragEndObservable.add(() => { instance.changeAim(); }); - this.showUI(false); + + // this.uiRoot = Button.CreateSimpleButton("ui_" + name, this.index.toString()); + // UIManager.Instance.uiRoot.addControl(this.uiRoot); + // this.uiRoot.linkWithMesh(this.mesh); + // BabylonUIStyleTool.setStyle_size(this.uiRoot, "20px", "20px"); + // this.uiRoot.background = BabylonUIStyleTool.c_color_blue; + // this.uiRoot.color = BabylonUIStyleTool.c_color_white; + // this.uiRoot.onPointerClickObservable.add(() => { + // instance.changeAim(); + // }); + + // this.showUI(false); } } @@ -318,7 +334,7 @@ export class PolygonMeshPoint { //改变选中的目标 changeAim() { let instance = this; - GizmoTool.changeGizmoAim(instance.mesh); + //GizmoTool.changeGizmoAim(instance.mesh); PosPointTool.attachMesh(instance.mesh as Mesh, instance.pos, () => { instance.addPoint(); @@ -337,6 +353,10 @@ export class PolygonMeshPoint { this.mesh.dispose(); this.uiRoot.dispose(); } + if (this.pointMat != null) { + this.pointMat.dispose(); + this.pointMat = null; + } } diff --git a/src/app/babylon/model/info/model/model-info-facility.ts b/src/app/babylon/model/info/model/model-info-facility.ts index 1725414..3603b59 100644 --- a/src/app/babylon/model/info/model/model-info-facility.ts +++ b/src/app/babylon/model/info/model/model-info-facility.ts @@ -8,7 +8,7 @@ import { FacilityWindow } from "src/app/babylon/view/facility-window/facility-wi import { FacilityInfoInSceneWindow } from "src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window"; import { PropertyBaseWindow } from "src/app/babylon/view/property-window/property-base-window"; import { ModelData } from "../../data/model-data/model-data"; -import { FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility"; +import { FacilityPosType, FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility"; import { BuildingInfo } from "../building/building-info"; import { AreaInfo } from "./facilityinfo-tool/facility-area"; @@ -16,6 +16,9 @@ import { ModelInfo } from "./model-info"; //设施数据 export class ModelInfo_facility extends ModelInfo { + + static readonly c_hightLightColor = Color3.Yellow(); + belongToBuilding: BuildingInfo;//属于哪个建筑 pickDown: boolean;//按下 facilityShowType: FacilityShowType;//设备展示状态 @@ -39,15 +42,15 @@ export class ModelInfo_facility extends ModelInfo { } onCreateFollowUI() { - let modelData = this.modelData as ModelData_facility; - if (!ConfigManager.getFacilityNeedIcon(modelData.facilityType)) { + let facilityData = this.modelData as ModelData_facility; + if (!ConfigManager.getFacilityNeedIcon(facilityData.facilityType)) { return; } super.onCreateFollowUI(); let instance = this; - let posType = ConfigManager.getPosType(modelData.facilityType); - let iconPath = ConfigManager.getFacilityIconUrl(modelData.facilityType, posType); + let posType = ConfigManager.getPosType(facilityData.facilityType); + let iconPath = ConfigManager.getFacilityIconUrl(facilityData.facilityType, posType); BabylonUIStyleTool.setStyle_size(this.uiFollowRoot, ConfigManager.c_size_facilityIconSize + "px", ConfigManager.c_size_facilityIconSize + "px"); this.uiFollowRoot.thickness = 0; @@ -93,7 +96,13 @@ export class ModelInfo_facility extends ModelInfo { }); this.uiFollowRoot.zIndex = BabylonUIStyleTool.c_zIndex_facilityIcon; - this.showFollowUI(false); + + if (facilityData.posType == FacilityPosType.In) { + this.showFollowUI(false); //内置设备,默认隐藏 + } + + + } @@ -141,7 +150,10 @@ export class ModelInfo_facility extends ModelInfo { * @param enable */ setSelectEnable(enable: boolean) { - this.ui_select.isVisible = enable; + if (this.ui_select != null) { + this.ui_select.isVisible = enable; + } + } /** @@ -159,14 +171,14 @@ export class ModelInfo_facility extends ModelInfo { } /** - * 播放展示动画(高亮) - * @param play false表示停止,并恢复正常 - */ + * 播放展示动画(高亮) + * @param play false表示停止,并恢复正常 + */ playShowAnim(play: boolean) { this.showFollowUI(play); if (this.modelBox != null) { if (play) { - SceneManager.Instance.addToHighLight(this.modelBox as Mesh, Color3.Yellow()); + SceneManager.Instance.addToHighLight(this.modelBox as Mesh, ModelInfo_facility.c_hightLightColor); } else { SceneManager.Instance.removeFromHighLight(this.modelBox as Mesh); diff --git a/src/app/babylon/model/info/model/model-info.ts b/src/app/babylon/model/info/model/model-info.ts index 9a28a13..f89684a 100644 --- a/src/app/babylon/model/info/model/model-info.ts +++ b/src/app/babylon/model/info/model/model-info.ts @@ -25,7 +25,7 @@ export class ModelInfo { /** * 所有子节点 */ - models: AbstractMesh[]; + _models: AbstractMesh[]; /** * 包装盒、根节点 ,请使用modelBox 属性进行访问 */ @@ -121,6 +121,20 @@ export class ModelInfo { } } + /** + * 模型的子节点们 + */ + get models(): AbstractMesh[] { + if (this._models == null) { + this._models = this.modelBox.getChildMeshes(); + } + return this._models; + } + + set models(value: AbstractMesh[]) { + this._models = value; + } + //创建跟随UI onCreateFollowUI() { diff --git a/src/app/babylon/tool/pos-point-tool.ts b/src/app/babylon/tool/pos-point-tool.ts index 058f5da..eb75013 100644 --- a/src/app/babylon/tool/pos-point-tool.ts +++ b/src/app/babylon/tool/pos-point-tool.ts @@ -19,14 +19,19 @@ export class PosPointTool { initUI() { let instance = this; this.uiRoot = new Rectangle("PosPointTooUI"); + this.uiRoot.color = BabylonUIStyleTool.c_color_3d_blueLight; + this.uiRoot.shadowBlur = 5; UIManager.Instance.uiRoot.addControl(this.uiRoot); BabylonUIStyleTool.setStyle_size(this.uiRoot, "40px", "20px"); let stack = new StackPanel("stack"); this.uiRoot.addControl(stack); + stack.width = 1; + stack.height = 1; stack.isVertical = false; + let btn_add = Button.CreateSimpleButton("add", "+"); stack.addControl(btn_add); btn_add.background = BabylonUIStyleTool.c_color_blue; @@ -52,7 +57,7 @@ export class PosPointTool { showUI(show: boolean) { this.uiRoot.isVisible = show; this.uiRoot.linkWithMesh(this.mesh); - this.uiRoot.linkOffsetY = "-50px"; + this.uiRoot.linkOffsetY = "-30px"; } //#endregion diff --git a/src/app/babylon/view/facility-window/facility-window.ts b/src/app/babylon/view/facility-window/facility-window.ts index d511de0..a1ebb1e 100644 --- a/src/app/babylon/view/facility-window/facility-window.ts +++ b/src/app/babylon/view/facility-window/facility-window.ts @@ -1,8 +1,10 @@ import { AbstractMesh, + Color3, EventState, Mesh, MeshBuilder, + PickingInfo, PointerEventTypes, PointerInfo, Vector3, @@ -23,6 +25,7 @@ import { BuildingStatus } from '../../controller/status/building-status'; import { IndoorStatus } from '../../controller/status/indoor-status'; import { StatusManager } from '../../controller/status/status-manager'; import { UIManager } from '../../controller/ui-manager'; +import { JYZInfoMoudleType } from '../../model/data/institution/jyz-show-data'; import { FacilityPosType, ModelData_facility, FacilityShowType, FacilityType } from '../../model/data/model-data/model-data-facility'; import { TransformData } from '../../model/data/transform-data'; import { BuildingInfo } from '../../model/info/building/building-info'; @@ -33,6 +36,7 @@ import { BabylonUIStyleTool } from '../../tool/babylon-ui-style-tool'; import { GizmoTool } from '../../tool/gizmo-tool'; import { TsTool } from '../../tool/ts-tool'; import { BuildingWindow } from '../building-window/building-window'; +import { FacilityInfoUIItem } from '../facilityinfoinscene-window/facilityinfo-ui-item'; import { CopyFacilityInfo, FacilityInfoInSceneWindow } from '../facilityinfoinscene-window/facilityinfoinscene-window'; import { ToolbarWindow } from '../toolbar-window/toobar-window'; import { UIBase } from '../window-base/ui-base'; @@ -49,6 +53,8 @@ export class FacilityWindow extends UIBase { static s_currentFacilityItem: FacilityUIItem; static instance: FacilityWindow; + + createIconRoot: Rectangle;//创建状态的跟随icon createIcon: Image; static readonly c_createIcon_width = 40; @@ -237,7 +243,12 @@ export class FacilityWindow extends UIBase { case PointerEventTypes.POINTERUP: if (eventData.event.button == 0) { //左键正常 + + if (eventData.pickInfo.hit && !SceneManager.s_isPointerDrag) { + + instance.selectJYJFrom3D(eventData.pickInfo); + if (FacilityWindow.s_currentFacilityItem != null) { instance.createNewFacilityByPos(eventData.pickInfo.pickedPoint); return; @@ -258,6 +269,7 @@ export class FacilityWindow extends UIBase { } } + //寻找设备预设 getFacilityPrefab(resName: string): Mesh { let result = null; @@ -309,24 +321,8 @@ export class FacilityWindow extends UIBase { } - /** - * 根据mesh创建设备 - * @param mesh - * @param type - */ - createNewFacilityByMesh(mesh: AbstractMesh, type: FacilityType) { - let facilityData = this.createFacilityDataFromMesh(mesh, type); - //let facilityInfo = this.createFacilityInfoFromMesh(facilityData, mesh, buildingInfo); - - - if (!this.isRepeatFacilityFromMesh(type, mesh.id)) //不重复 - { - console.log("获取到设备" + type, mesh); - this.createNewFacility(facilityData, mesh); - } - } /** @@ -730,4 +726,123 @@ export class FacilityWindow extends UIBase { //#endregion + + //#region 加油机特殊表现 + + /** + * 选中加油机时,高亮颜色 + */ + static readonly c_selectJYJColor = Color3.Green(); + + /** + * 当前选中的加油机 + */ + currentSelectJYJInfo: ModelInfo_facility; + + /** + * 根据mesh创建设备 + * @param mesh + * @param type + */ + createNewFacilityByMesh(mesh: AbstractMesh, type: FacilityType) { + let facilityData = this.createFacilityDataFromMesh(mesh, type); + //let facilityInfo = this.createFacilityInfoFromMesh(facilityData, mesh, buildingInfo); + + + if (!this.isRepeatFacilityFromMesh(type, mesh.id)) //不重复 + { + console.log("获取到设备" + type, mesh); + this.createNewFacility(facilityData, mesh); + } + + + } + + /** + * 三维中通过点击模型获取加油机(或油罐) + * @param pickInfo null 表示取消选中 + */ + selectJYJFrom3D(pickInfo: PickingInfo) { + + if (this.currentSelectJYJInfo != null) { + this.playJYJSelectEffect(false, this.currentSelectJYJInfo); + this.currentSelectJYJInfo = null; + } + + if (pickInfo == null) { + return; + } + + let allJYJInfo: ModelInfo_facility[] = []; + + try { + let facilityInfosByType = BuildingWindow.instance.currentBuidngItem.buildingInfo.ModelInfo.facilityInfos; + + for (let i = 0; i < facilityInfosByType.length; i++) { + if (facilityInfosByType[i].type == FacilityType.JY_JYJ || facilityInfosByType[i].type == FacilityType.JY_YG) { + allJYJInfo = allJYJInfo.concat(facilityInfosByType[i].facilityInfo); + } + } + + + } catch (error) { + console.log("没找到加油机", error); + } + + let result: ModelInfo_facility = null; + + + for (let i = 0; i < allJYJInfo.length; i++) { + let childMesh = allJYJInfo[i].models; + childMesh.push(allJYJInfo[i].modelBox); + for (let j = 0; j < childMesh.length; j++) { + if (pickInfo.pickedMesh == childMesh[j]) { + result = allJYJInfo[i]; + console.log("通过点击,找到加油机了"); + break; + } + } + } + + + if (result != null) { + this.currentSelectJYJInfo = result; + this.playJYJSelectEffect(true, this.currentSelectJYJInfo); + let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(result); + console.log("场景中选中设备", facilityItem); //通知前端 + FacilityInfoInSceneWindow.instance.selectFacilityItemToThree([facilityItem], true); + } + } + + /** + * 展示加油机(或油罐)选中的效果 + * @param play false,表示还原 + */ + playJYJSelectEffect(play: boolean, facilityInfo: ModelInfo_facility) { + + if (play) { + //正在展示加油机或油罐 + if (BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.JYJ + || BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.YG) { + SceneManager.Instance.removeFromHighLight(facilityInfo.modelBox as Mesh); + } + SceneManager.Instance.addToHighLight(facilityInfo.modelBox as Mesh, FacilityWindow.c_selectJYJColor); + + } + else { + SceneManager.Instance.removeFromHighLight(facilityInfo.modelBox as Mesh); + //正在展示加油机或油罐 + if (BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.JYJ + || BuildingWindow.instance.currentJYZInfoMoudleType == JYZInfoMoudleType.YG) { + SceneManager.Instance.addToHighLight(facilityInfo.modelBox as Mesh, ModelInfo_facility.c_hightLightColor); + } + + } + + + } + + + //#endregion + }