diff --git a/src/app/babylon/controller/mode-manager.ts b/src/app/babylon/controller/mode-manager.ts index 5bf14b6..4f3c9fd 100644 --- a/src/app/babylon/controller/mode-manager.ts +++ b/src/app/babylon/controller/mode-manager.ts @@ -15,15 +15,15 @@ export enum ModeType { export class ModeManager { /** - * 当前模式的类型(编辑模式代表内部编辑人员,可新增单位、上传模型,查看模式代表交付的模式) + * 当前模式的类型 * 外部使用 currentMode 属性访问和修改 */ private static s_currentMode: ModeType = ModeType.Edit; /** - * 高级权限,表示某些高级功能的开放 + * 制作模式代表内部编辑人员,可新增单位、上传模型,查看模式代表交付的模式 */ - public static highPower = true; + public static s_isMakeMode = true; /** * 调试模式 @@ -52,7 +52,7 @@ export class ModeManager { //#endregion /** - * 获取当前模式的类型 + * 获取当前模式的类型(查看或编辑,用户权限有关) */ static get currentMode(): ModeType { return ModeManager.s_currentMode; diff --git a/src/app/babylon/controller/scene-manager.ts b/src/app/babylon/controller/scene-manager.ts index c285922..cb7899e 100644 --- a/src/app/babylon/controller/scene-manager.ts +++ b/src/app/babylon/controller/scene-manager.ts @@ -476,7 +476,7 @@ export class SceneManager { ) { // console.log("准备加载"); - let defaultMesh = MeshBuilder.CreateBox(modelData.key, { size: 0.01 }); + let defaultMesh = MeshBuilder.CreateBox(modelData.key + "Box", { size: 0.01 }); defaultMesh.scaling.y = 0.01; defaultMesh.visibility = 0; diff --git a/src/app/babylon/model/info/model/model-info-building.ts b/src/app/babylon/model/info/model/model-info-building.ts index 337a043..68345d8 100644 --- a/src/app/babylon/model/info/model/model-info-building.ts +++ b/src/app/babylon/model/info/model/model-info-building.ts @@ -50,7 +50,7 @@ export class ModelInfo_building extends ModelInfo { for (let i = 0; i < allTransformNode.length; i++) { if (TsTool.stringContain(allTransformNode[i].name, "WAI")) { this.neiRoot = allTransformNode[i]; - console.log("找到关键节点wai"); + break; } } @@ -58,6 +58,10 @@ export class ModelInfo_building extends ModelInfo { if (this.neiRoot == null) { + if (!TsTool.stringContain(this.modelBox.name, "Box")) { + console.error("没有关键节点", this.modelBox.name); + } + this.neiRoot = this.modelBox; } @@ -156,6 +160,9 @@ export class ModelInfo_building extends ModelInfo { //更新跟随UI的名称 updateName(name: string) { this.uiIconBtn.textBlock.text = name; + if (!ModeManager.s_isMakeMode) { + this.showFollowUI(false); + } } diff --git a/src/app/babylon/tool/gizmo-tool.ts b/src/app/babylon/tool/gizmo-tool.ts index 199d4e2..632c872 100644 --- a/src/app/babylon/tool/gizmo-tool.ts +++ b/src/app/babylon/tool/gizmo-tool.ts @@ -425,7 +425,7 @@ export class GizmoTool { : UIBase.color_null; GizmoTool.s_gizmoManager.scaleGizmoEnabled = isScaling; - if (uiType == TransformUIType.Hide) { //隐藏选中框 + if (uiType == TransformUIType.Hide || !ModeManager.s_isMakeMode) { //隐藏选中框 GizmoTool.s_boundingBoxGizmo.attachedMesh = null; } diff --git a/src/app/babylon/view/building-window/building-window.ts b/src/app/babylon/view/building-window/building-window.ts index ea2e0b7..4ef7789 100644 --- a/src/app/babylon/view/building-window/building-window.ts +++ b/src/app/babylon/view/building-window/building-window.ts @@ -218,8 +218,6 @@ export class BuildingWindow extends UIBase { * @param show true表示显示 */ showJYZInfoModel(type: JYZInfoMoudleType, show: boolean) { - console.log("showJYZInfoModel", type, show); - if (this.currentJYZInfoMoudleType == type) { if (show) { return; //与上次显示的模块相同 @@ -875,7 +873,6 @@ export class BuildingWindow extends UIBase { if (!isRepeat)//不重复,就添加进去 { this.mat_UV.get(moudleType).push(l_mat); - console.log("找到uv", l_mat); } } }