修复bug
This commit is contained in:
@ -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;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user