修复bug

This commit is contained in:
2026-05-25 13:08:56 +08:00
parent c6257883e5
commit 266c0c154e
3 changed files with 161 additions and 21 deletions

View File

@ -506,6 +506,8 @@ export class AppDropZone {
*/
show(): void {
this.placementWall.show();
// 禁用所有已放置模型的拾取
this.setModelsPickable(false);
}
/**
@ -514,6 +516,8 @@ export class AppDropZone {
*/
showWall(wallName: string): void {
this.placementWall.showWall(wallName);
// 禁用所有已放置模型的拾取
this.setModelsPickable(false);
}
/**
@ -521,6 +525,25 @@ export class AppDropZone {
*/
hide(): void {
this.placementWall.hide();
// 恢复所有已放置模型的拾取
this.setModelsPickable(true);
}
/**
* 设置所有已放置模型的可拾取状态
* @param pickable 是否可拾取
*/
private setModelsPickable(pickable: boolean): void {
if (!this.appModel) return;
this.zoneModelMap.forEach((modelId) => {
const meshes = this.appModel!.getCachedMeshes(modelId);
if (meshes && meshes.length > 0) {
meshes.forEach(mesh => {
mesh.isPickable = pickable;
});
}
});
}
/**