//====================================================== //====================================================== // Helper Methods: // Helper method to switch scene when required. public void switchScene(POCC.Scenes.Scene scene) { _currentScene.getTeardownHooks()(); SceneManager.LoadScene(scene.getLocation()); scene = sceneChangeHook(scene); scene.getStartupHooks()(); _currentScene = scene; }
/** * Hook that the game manager can use if needing to do some general setting * of state */ public POCC.Scenes.Scene sceneChangeHook(POCC.Scenes.Scene scene) { // Do things here if (scene.getSceneType() == SceneType.GAME_OVER) { _tempScenes.Push(_currentScene); return(scene); } else if (_currentScene.getSceneType() == SceneType.GAME_OVER && scene.getSceneType() != SceneType.MAIN_MENU) { POCC.Scenes.Scene tempScene = _tempScenes.Pop(); // TODO: Consider differences if used switchScene(scene) SceneManager.LoadScene(tempScene.getLocation()); return(tempScene); } return(scene); }