From f4161cb57d7732a93b85b44cd199116058a4f3de Mon Sep 17 00:00:00 2001 From: adeliptr Date: Thu, 1 May 2025 16:27:01 +0900 Subject: [PATCH] add exit to scenemanager --- js/scenemanager.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/scenemanager.js b/js/scenemanager.js index bbf9efb..64f5d33 100644 --- a/js/scenemanager.js +++ b/js/scenemanager.js @@ -69,8 +69,10 @@ function SceneManager(p) hasSetup : "setup" in oScene, hasEnter : "enter" in oScene, hasDraw : "draw" in oScene, + hasExit : "exit" in oScene, setupExecuted : false, - enterExecuted : false }; + enterExecuted : false + }; this.scenes.push(o); return o; @@ -118,6 +120,10 @@ function SceneManager(p) // Re-arm the enter function at each show of the scene o.enterExecuted = false; + if (this.scene && this.scene.hasExit) { + this.scene.oScene.exit(); + } + this.scene = o; // inject sceneArgs as a property of the scene