void removeScene <T>() where T : SceneViewBase { T sc = getScene <T>(); if (sc == null) { return; } sc.onDestroyed(); scenes.Remove(sc); if (currentScene == sc) { currentScene = null; } }
T setNextScene <T>() where T : SceneViewBase, new() { T scene = getScene <T>(); if (scene == null) { scene = createScene <T>(); } else if (scene == currentScene) { return(scene); } if (currentScene != null) { currentScene.onExit(); } currentScene = scene; currentScene.onEnter(); return(scene); }