static public void ToPrevScene() { if (CurrentScene.PreviousScene != null) { CurrentScene.OnExit(); CurrentScene = CurrentScene.PreviousScene; CurrentScene.Start(); } }
//Inizializzazione static Game() { GameSetting(); GfxMgr.LoadAll(); TimeMgr.Init(); AllScenes = new Scene[] { new LogoScene(), new MenuScene(), new PlayScene(), }; for (int i = 0; i < AllScenes.Length; i++) { if (i - 1 >= 0) { AllScenes[i].PreviousScene = AllScenes[i - 1]; } if (i + 1 < AllScenes.Length) { AllScenes[i].NextScene = AllScenes[i + 1]; } } CurrentScene = AllScenes[(int)SceneType.Title]; CurrentScene.Start(); #region Old Scenes // titlescene = new TitleScene(); // menuscene = new MenuScene(); // playscene = new PlayScene(); // //gameoverscene = new GameOverScene(); // // CurrentScene = titlescene; // //CurrentScene = playscene; // //titlescene.NextScene = playscene; // titlescene.NextScene = menuscene; // menuscene.PreviousScene = titlescene; // menuscene.NextScene = playscene; // playscene.PreviousScene = menuscene; // //playscene.PreviousScene = titlescene; // playscene.NextScene = null; // //playscene.NextScene = gameoverscene; // //gameoverscene.PreviousScene = playscene; // //gameoverscene.NextScene = null; // titlescene.Start(); // //playscene.Start(); #endregion string[] joysticks = window.Joysticks; for (int i = 0; i < joysticks.Length; i++) { if (joysticks[i] != null && joysticks[i] != "Unmapped Controller") { numJS++; } } GamepadSetting(); }
static public void ToSelectedScene(SceneType index) { CurrentScene.OnExit(); CurrentScene = AllScenes[(int)index]; CurrentScene.Start(); }
static public void ToNextScene() { CurrentScene.OnExit(); CurrentScene = CurrentScene.NextScene; CurrentScene.Start(); }