add exit to scenemanager

This commit is contained in:
adeliptr 2025-05-01 16:27:01 +09:00
parent 29ace4909f
commit f4161cb57d

View File

@ -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