From ae361b8d9795f4bf0f186de830715165b520862c Mon Sep 17 00:00:00 2001 From: Gnlow Date: Sat, 30 Dec 2023 11:56:37 +0900 Subject: [PATCH] fix: start only current scene --- src/Entry.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Entry.ts b/src/Entry.ts index 5369fde..109a5d9 100644 --- a/src/Entry.ts +++ b/src/Entry.ts @@ -225,7 +225,7 @@ export class Entry { this.events[eventName].push(f) } start() { - this.emit("start") + this.emit(`run_scene_${this.currentScene.label}`) } render() { this.renderer!.render({ @@ -252,8 +252,11 @@ export class Entry { } /* 시작 */ - when_run_button_click(f: () => Promise) { - this.on("start", f) + when_run_button_click( + f: () => Promise, + obj: EntryContainer, + ) { + this.on(`run_scene_${obj.scene}`, f) } when_some_key_pressed(keyCode: string, f: () => Promise) { document.body.addEventListener("keydown", e => {