Skip to content

Commit

Permalink
Made requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv-0-Arora committed Jul 16, 2024
1 parent a489135 commit cbcf154
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion fission/src/mirabuf/MirabufSceneObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions fission/src/ui/modals/spawning/ManageAssembliesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const AssemblyCard: React.FC<AssemblyCardProps> = ({ id, update }) => {
<Label className="text-wrap break-all">{id}</Label>
<Button
value="Delete"
// prettier-ignore
onClick={() => {
(World.SceneRenderer.sceneObjects.get(id) as MirabufSceneObject).DisableTransformControls()
World.SceneRenderer.RemoveSceneObject(id)
update()
}}
Expand Down

0 comments on commit cbcf154

Please sign in to comment.