From cbcf154de3a98aaab8bd87e67f73f36cedb2a130 Mon Sep 17 00:00:00 2001 From: arorad1 Date: Mon, 15 Jul 2024 18:01:30 -0700 Subject: [PATCH] Made requested changes --- fission/src/mirabuf/MirabufSceneObject.ts | 3 ++- fission/src/ui/modals/spawning/ManageAssembliesModal.tsx | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fission/src/mirabuf/MirabufSceneObject.ts b/fission/src/mirabuf/MirabufSceneObject.ts index 7ff655aca0..0c4bbab0fe 100644 --- a/fission/src/mirabuf/MirabufSceneObject.ts +++ b/fission/src/mirabuf/MirabufSceneObject.ts @@ -112,7 +112,6 @@ class MirabufSceneObject extends SceneObject { return } else if (InputSystem.isKeyPressed("Escape")) { // cancelling the creation of the mirabuf scene object - this.DisableTransformControls() World.SceneRenderer.RemoveSceneObject(this.id) return } @@ -147,6 +146,7 @@ class MirabufSceneObject extends SceneObject { } public Dispose(): void { + this.DisableTransformControls() World.SimulationSystem.UnregisterMechanism(this._mechanism) World.PhysicsSystem.DestroyMechanism(this._mechanism) this._mirabufInstance.Dispose(World.SceneRenderer.scene) @@ -216,6 +216,7 @@ class MirabufSceneObject extends SceneObject { * Changes the mode of the mirabuf object from being placed to being interacted with. */ public DisableTransformControls(): void { + if (!this._transformGizmos) return this._transformGizmos?.RemoveGizmos() this._transformGizmos = undefined this.EnablePhysics() diff --git a/fission/src/ui/modals/spawning/ManageAssembliesModal.tsx b/fission/src/ui/modals/spawning/ManageAssembliesModal.tsx index b4be3a52a8..3031aec4c9 100644 --- a/fission/src/ui/modals/spawning/ManageAssembliesModal.tsx +++ b/fission/src/ui/modals/spawning/ManageAssembliesModal.tsx @@ -20,9 +20,7 @@ const AssemblyCard: React.FC = ({ id, update }) => {