|
|
@ -1,5 +1,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
import { Observable, Observer } from "@babylonjs/core"; |
|
|
|
import { Observable, Observer } from "@babylonjs/core"; |
|
|
|
|
|
|
|
import { PlanComponent } from "src/app/pages/plan/plan.component"; |
|
|
|
import { Game } from "../../game"; |
|
|
|
import { Game } from "../../game"; |
|
|
|
import { BuildingType, BuildingData } from "../../model/data/institution/building/building-data"; |
|
|
|
import { BuildingType, BuildingData } from "../../model/data/institution/building/building-data"; |
|
|
|
import { FacilityPosType, ModelData_facility } from "../../model/data/model-data/model-data-facility"; |
|
|
|
import { FacilityPosType, ModelData_facility } from "../../model/data/model-data/model-data-facility"; |
|
|
@ -59,7 +60,7 @@ export class BuildingStatus extends StatusBase { |
|
|
|
onEnter() { |
|
|
|
onEnter() { |
|
|
|
super.onEnter(); |
|
|
|
super.onEnter(); |
|
|
|
Game.instance.engine.resize(); |
|
|
|
Game.instance.engine.resize(); |
|
|
|
|
|
|
|
this.buildingWindow = BuildingWindow.instance; |
|
|
|
//首次进入
|
|
|
|
//首次进入
|
|
|
|
if (this.buildingWindow == null) { |
|
|
|
if (this.buildingWindow == null) { |
|
|
|
SceneManager.s_facilityWindow = UIManager.open<FacilityWindow>(FacilityWindow); |
|
|
|
SceneManager.s_facilityWindow = UIManager.open<FacilityWindow>(FacilityWindow); |
|
|
@ -76,19 +77,19 @@ export class BuildingStatus extends StatusBase { |
|
|
|
else { //从室内返回
|
|
|
|
else { //从室内返回
|
|
|
|
UIManager.show<BuildingWindow>(this.buildingWindow); |
|
|
|
UIManager.show<BuildingWindow>(this.buildingWindow); |
|
|
|
if (this.buildingWindow.currentBuidngItem != null) { |
|
|
|
if (this.buildingWindow.currentBuidngItem != null) { |
|
|
|
this.buildingWindow.currentBuidngItem.select(); |
|
|
|
PlanComponent.instance.selectLeftBuilding(this.buildingWindow.currentBuidngItem); |
|
|
|
BuildingStatus.startEnterObservable.notifyObservers(this.buildingWindow.currentBuidngItem); |
|
|
|
BuildingStatus.startEnterObservable.notifyObservers(this.buildingWindow.currentBuidngItem); |
|
|
|
BuildingStatus.enterSuccessObservable.notifyObservers(this.buildingWindow.currentBuidngItem) |
|
|
|
BuildingStatus.enterSuccessObservable.notifyObservers(this.buildingWindow.currentBuidngItem) |
|
|
|
if (MarkWindow.s_cameraData == null) { |
|
|
|
// if (MarkWindow.s_cameraData == null) {
|
|
|
|
this.buildingWindow.currentBuidngItem.lookAt(); |
|
|
|
// this.buildingWindow.currentBuidngItem.lookAt();
|
|
|
|
} |
|
|
|
// }
|
|
|
|
else { |
|
|
|
// else {
|
|
|
|
|
|
|
|
|
|
|
|
MarkWindow.s_cameraData.setDataToCamera(SceneManager.Instance.defaultCamera); |
|
|
|
// MarkWindow.s_cameraData.setDataToCamera(SceneManager.Instance.defaultCamera);
|
|
|
|
MarkWindow.s_cameraData = null; |
|
|
|
// MarkWindow.s_cameraData = null;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
FacilityInfoInSceneWindow.instance.createAllFacilities(this.buildingWindow.currentBuidngItem.buildingInfo.ModelInfo.facilityInfos); |
|
|
|
//FacilityInfoInSceneWindow.instance.createAllFacilities(this.buildingWindow.currentBuidngItem.buildingInfo.ModelInfo.facilityInfos);
|
|
|
|
if (ModeManager.currentMode == ModeType.Look) { |
|
|
|
if (ModeManager.currentMode == ModeType.Look) { |
|
|
|
FacilityInfoInSceneWindow.instance.showFacilityByType(null, false); |
|
|
|
FacilityInfoInSceneWindow.instance.showFacilityByType(null, false); |
|
|
|
} |
|
|
|
} |
|
|
@ -117,9 +118,9 @@ export class BuildingStatus extends StatusBase { |
|
|
|
//改变当前选中的建筑
|
|
|
|
//改变当前选中的建筑
|
|
|
|
changeCurrentBuilding(buildingInfo: BuildingInfo) { |
|
|
|
changeCurrentBuilding(buildingInfo: BuildingInfo) { |
|
|
|
|
|
|
|
|
|
|
|
if (buildingInfo == this.currentBuildingInfo) { |
|
|
|
// if (buildingInfo == this.currentBuildingInfo) {
|
|
|
|
return; |
|
|
|
// return;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("改变当前建筑" + buildingInfo.buildingData.normalData.key);
|
|
|
|
// console.log("改变当前建筑" + buildingInfo.buildingData.normalData.key);
|
|
|
|
//FacilityInfoInSceneWindow.instance.clearFacilityInfoUIItemes();
|
|
|
|
//FacilityInfoInSceneWindow.instance.clearFacilityInfoUIItemes();
|
|
|
@ -165,4 +166,5 @@ export class BuildingStatus extends StatusBase { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |