32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
export default function previewtunnelModeInit(equipmentList) {
|
|
//初始化将墙壁隐藏起来
|
|
// for (let line = 1; line <= 20; line++) {
|
|
// if (line < 10) {
|
|
// let wall = 'wall_' + '0' + line
|
|
// this.scene.getObjectByName(wall).visible = false
|
|
// } else if (line >= 10) {
|
|
// let wall = 'wall_' + line
|
|
// this.scene.getObjectByName(wall).visible = false
|
|
// }
|
|
// }
|
|
|
|
equipmentList.forEach((item) => {
|
|
const formInfo = {
|
|
equipmentType: item.equipmentType, //设备类型
|
|
chooseEquipment: item.chooseEquipment, //设备选择(设备名称)
|
|
threshold: item.threshold,
|
|
};
|
|
this.addEquipment(this.scene.getObjectByName(item.position), formInfo);
|
|
});
|
|
//进行预览和编辑模式的一些操作
|
|
if (this.isedit == false) {
|
|
this.scene.traverse(function (item) {
|
|
if (item.name.includes('point')) {
|
|
if (item.hasDevice == false) {
|
|
item.visible = false
|
|
item.layers.set(-1)
|
|
}
|
|
}
|
|
})
|
|
}
|
|
} |