/// <summary> /// どのシーンから初めても初期化する /// </summary> private void SetFirstScene() { if (SceneManager.GetActiveScene().name == m_title.Name) { m_currentScene = m_title; } else if (SceneManager.GetActiveScene().name == m_revised.Name) { m_currentScene = m_revised; } else if (SceneManager.GetActiveScene().name == m_battle.Name) { m_currentScene = m_battle; } else if (SceneManager.GetActiveScene().name == m_result.Name) { m_currentScene = m_result; } else if (SceneManager.GetActiveScene().name == m_captureTutorial.Name) { m_currentScene = m_captureTutorial; } else if (SceneManager.GetActiveScene().name == m_battleTutorial.Name) { m_currentScene = m_battleTutorial; } else if (SceneManager.GetActiveScene().name == m_ending.Name) { m_currentScene = m_ending; } // 初期化する m_currentScene.Initialize(this); }
/// <summary> /// シーンを変更する /// </summary> /// <param name="nextScene">次のシーン名</param> /// <param name="mode">ロードシーンモード</param> public async void ChangeScene(IScene_Script nextScene, LoadSceneMode mode = LoadSceneMode.Single) { await TransitionManager_Script.OnTransitionFinishedAsync(); // 終了処理をする m_currentScene.Dispose(); // 次のシーンを設定する m_currentScene = nextScene; // 遷移する //TransitionManager_Script.StartTransition(m_currentScene.Name, mode); // ActiveSceneを切り替える if (SceneManager.GetActiveScene().isLoaded) { SceneManager.SetActiveScene(SceneManager.GetSceneByName(m_currentScene.Name)); } // 初期化する m_currentScene.Initialize(this); }
/// <summary> /// シーンを生成する /// </summary> private void CreateScene() { // TitleScene m_title = new SceneTitle_Script(); m_title.Name = "TitleScene"; // Revised m_revised = new SceneRevised_Script(); m_revised.Name = "Revised"; // BattleScene m_battle = new SceneBattle_Script(); m_battle.Name = "BattleScene"; // ResultScene m_result = new SceneResult_Script(); m_result.Name = "ResultScene"; // TutorialScene m_captureTutorial = new SceneCaptureTutorial_Script(); m_captureTutorial.Name = "TutorialCaptureScene"; m_battleTutorial = new SceneBattleTutorial_Script(); m_battleTutorial.Name = "TutorialBattleScene"; // EndingScene m_ending = new SceneEnding_Script(); m_ending.Name = "EndingScene"; }