diff --git a/src/app/babylon/view/building-window/building-window.ts b/src/app/babylon/view/building-window/building-window.ts index 7f8d495..ba28401 100644 --- a/src/app/babylon/view/building-window/building-window.ts +++ b/src/app/babylon/view/building-window/building-window.ts @@ -904,6 +904,16 @@ export class BuildingWindow extends UIBase { } //SceneManager.Instance.openInnerGlow(!isShowNameUI_JYJ_YG); //输油管和油气回收管太细,关闭内发光 + switch (type) { + case JYZInfoMoudleType.SYG: + this.showFacilityByType(this.facilitysByMoudle, JYZInfoMoudleType.YQHSGX, false); + this.showFacilityByType(this.facilitysByMoudle, JYZInfoMoudleType.SYG, true); + break; + case JYZInfoMoudleType.YQHSGX: + this.showFacilityByType(this.facilitysByMoudle, JYZInfoMoudleType.SYG, false); + this.showFacilityByType(this.facilitysByMoudle, JYZInfoMoudleType.YQHSGX, true); + break; + } if (show) { @@ -1144,6 +1154,28 @@ export class BuildingWindow extends UIBase { } + /** + * 显示或隐藏某个模块下的所有设备 + * @param facilitysByMoudle + * @param type + * @param show + */ + showFacilityByType(facilitysByMoudle: Map, type: JYZInfoMoudleType, show: boolean) { + let facilityByType = this.facilitysByMoudle.get(type); + if (facilityByType != null) { + facilityByType.forEach(element => { + let facilitys = element.facilityInfo; + if (facilitys != null) { + facilitys.forEach(facility => { + facility.setEnable(show); + }) + } + + }); + } + + } + //#endregion