diff --git a/packages/core-editor/src/editor/core-editor.ts b/packages/core-editor/src/editor/core-editor.ts index 40e52ad..033a488 100644 --- a/packages/core-editor/src/editor/core-editor.ts +++ b/packages/core-editor/src/editor/core-editor.ts @@ -35,7 +35,6 @@ export class CoreEditor { public hotReloadEvent(save: Save): void { const reg = this.ecsLibrary.registry; - this.lastLoadedSave = JSON.parse(JSON.stringify(save)); save.entities.forEach(({ id, components }) => { Object.entries(components).forEach(([componentName, params]) => { const ogComponent = save.components.find(({ name }) => name === componentName); @@ -55,6 +54,7 @@ export class CoreEditor { reg.addComponent(ecsEntity, ecsComponent); }); }); + this.lastLoadedSave = JSON.parse(JSON.stringify(save)); } public hardReloadEvent(save: Save): void { diff --git a/packages/graphics-2d/src/graphics-2d.library.ts b/packages/graphics-2d/src/graphics-2d.library.ts index 8781025..eaa60db 100644 --- a/packages/graphics-2d/src/graphics-2d.library.ts +++ b/packages/graphics-2d/src/graphics-2d.library.ts @@ -72,4 +72,9 @@ export class Graphics2DLibrary extends BaseGraphicsLibrary { /** @internal */ public async __run(): Promise {} + + /** @internal */ + public override async __clear(): Promise { + this._stage?.destroy(); + } }