|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
|
|
|
|
|
import { AbstractMesh, Material, Mesh } from "@babylonjs/core"; |
|
|
|
|
import { AbstractMesh, Material, Mesh, PBRMaterial, Texture } from "@babylonjs/core"; |
|
|
|
|
import { PlanComponent } from "src/app/pages/plan/plan.component"; |
|
|
|
|
import { DataManager } from "../../controller/data-manager"; |
|
|
|
|
import { InfoManager } from "../../controller/info-manager"; |
|
|
|
@ -276,7 +276,10 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
this.three = PlanComponent.instance; |
|
|
|
|
this.three.buildingUIItems = this.buildingUIItems |
|
|
|
|
this.buildingUIItems.length ? this.three.beforeOneBuildingID = this.three.buildingUIItems[0].getBuildingID() : null |
|
|
|
|
|
|
|
|
|
let instance = this; |
|
|
|
|
SceneManager.Instance.scene.onBeforeRenderObservable.add(() => { |
|
|
|
|
instance.onUpdate(); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onShow() { |
|
|
|
@ -289,6 +292,11 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
super.onHide(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onUpdate() { |
|
|
|
|
this.updateUVAnim(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -335,6 +343,8 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
|
|
|
|
|
console.log("选中建筑", modelInfo); |
|
|
|
|
this.showJYZModules(JYZInfoMoudleType.AQSS, false); |
|
|
|
|
this.showJYZModules(JYZInfoMoudleType.YQHSGX, false); |
|
|
|
|
this.showJYZModules(JYZInfoMoudleType.YQHSGX, false); |
|
|
|
|
|
|
|
|
|
//this.onChangeCurrentBuildingItem(item);
|
|
|
|
|
|
|
|
|
@ -573,6 +583,11 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
*/ |
|
|
|
|
readonly c_xiaoFang = "XF_"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 安全疏散 |
|
|
|
|
*/ |
|
|
|
|
readonly c_shuSan = "AQSS_"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 加油站相关 |
|
|
|
|
*/ |
|
|
|
@ -629,6 +644,9 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
{ |
|
|
|
|
this.currentBuidngItem.createFacilityByMesh(allNode[i]); |
|
|
|
|
} |
|
|
|
|
else if (TsTool.stringContain(nodeName, this.c_shuSan)) { |
|
|
|
|
this.currentBuidngItem.createAQSSFromMesh(allNode[i]);//安全疏散
|
|
|
|
|
} |
|
|
|
|
else if (TsTool.stringContain(nodeName, this.c_jiaYou))//加油站
|
|
|
|
|
{ |
|
|
|
|
this.currentBuidngItem.createOilingByMesh(allNode[i]); |
|
|
|
@ -647,6 +665,11 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
|
|
|
|
|
//#region 加油站基本信息模块的显隐表现
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 箭头UV动画速度 |
|
|
|
|
*/ |
|
|
|
|
readonly c_uvAnimSpeed = 0.001; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 当前查看的加油站信息模块类型 |
|
|
|
|
*/ |
|
|
|
@ -672,6 +695,8 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
*/ |
|
|
|
|
currentZPShow: boolean = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 展示加油站信息模块 |
|
|
|
|
* @param type
|
|
|
|
@ -702,17 +727,12 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//阻挡类物体
|
|
|
|
|
let zdByType: FacilityInfoByType[] = []; |
|
|
|
|
if (this.zdByMoudle.has(type)) { |
|
|
|
|
zdByType = this.zdByMoudle.get(type); |
|
|
|
|
console.log("查找阻挡物", type, zdByType); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
console.log("没找到阻挡物", type, zdByType); |
|
|
|
|
} |
|
|
|
|
for (let i = 0; i < zdByType.length; i++) { |
|
|
|
|
let infos = zdByType[i].facilityInfo; |
|
|
|
@ -722,6 +742,7 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (show) { |
|
|
|
|
this.currentJYZInfoMoudleType = type; |
|
|
|
|
} |
|
|
|
@ -841,6 +862,7 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
if (!isRepeat)//不重复,就添加进去
|
|
|
|
|
{ |
|
|
|
|
this.mat_UV.get(moudleType).push(l_mat); |
|
|
|
|
console.log("找到uv", l_mat); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -859,18 +881,39 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
for (let i = 0; i < childMesh.length; i++) { |
|
|
|
|
let mat = childMesh[i].material; |
|
|
|
|
if (TsTool.stringContain(mat.name, this.c_MAT_UV)) { |
|
|
|
|
// for(let j =0;j< result.length;j++)
|
|
|
|
|
// {
|
|
|
|
|
// if(mat != result[j])
|
|
|
|
|
// {
|
|
|
|
|
result.push(mat); |
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* uv动画 update |
|
|
|
|
*/ |
|
|
|
|
updateUVAnim() { |
|
|
|
|
// console.log("uv", this.mat_UV);
|
|
|
|
|
if (this.mat_UV == null || this.currentJYZInfoMoudleType == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let mats = this.mat_UV.get(this.currentJYZInfoMoudleType); |
|
|
|
|
if (mats == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (let i = 0; i < mats.length; i++) { |
|
|
|
|
let mat = mats[i]; |
|
|
|
|
if (mat instanceof PBRMaterial) { |
|
|
|
|
|
|
|
|
|
(mat.albedoTexture as Texture).vOffset += SceneManager.Instance.scene.deltaTime * this.c_uvAnimSpeed; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存展示模块当前数据 |
|
|
|
|
*/ |
|
|
|
|