Refactor scene exit handling in viewport-host.ts
This commit is contained in:
@@ -3759,13 +3759,6 @@ export class ViewportHost {
|
|||||||
(interactable) => [interactable.entityId, interactable]
|
(interactable) => [interactable.entityId, interactable]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const runtimeSceneExitsByEntityId = new Map(
|
|
||||||
(this.currentSimulationScene?.entities.sceneExits ?? []).map((sceneExit) => [
|
|
||||||
sceneExit.entityId,
|
|
||||||
sceneExit
|
|
||||||
])
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const entity of getEntityInstances(document.entities)) {
|
for (const entity of getEntityInstances(document.entities)) {
|
||||||
if (!entity.enabled || !entity.visible) {
|
if (!entity.enabled || !entity.visible) {
|
||||||
continue;
|
continue;
|
||||||
@@ -3810,18 +3803,6 @@ export class ViewportHost {
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "sceneExit": {
|
|
||||||
const runtimeSceneExit = runtimeSceneExitsByEntityId.get(entity.id) ?? null;
|
|
||||||
renderObjects = this.createInteractableRenderObjects(
|
|
||||||
entity.id,
|
|
||||||
entity.position,
|
|
||||||
entity.radius,
|
|
||||||
selected,
|
|
||||||
runtimeSceneExit?.interactionEnabled ?? entity.interactionEnabled,
|
|
||||||
selected ? SCENE_EXIT_SELECTED_COLOR : SCENE_EXIT_COLOR
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
renderObjects = this.createEntityRenderObjects(entity, selected);
|
renderObjects = this.createEntityRenderObjects(entity, selected);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user