/// <summary> /// Funciton to translate the string to a scene /// </summary> /// <param name="myString"></param> /// <returns></returns> private SceneToLoad stringToScene(string myString) { SceneToLoad returnScene = SceneToLoad.None; switch (myString) { case "Plein": returnScene = SceneToLoad.Plein; break; case "Bunker": returnScene = SceneToLoad.Bunker; break; case "Door": returnScene = SceneToLoad.Door; break; case "Street": returnScene = SceneToLoad.Street; break; case "Parkeerplaats": returnScene = SceneToLoad.Parkeerplaats; break; case "StreetTutorial": returnScene = SceneToLoad.StreetTutorial; break; } return(returnScene); }
public void LoadScene(SceneToLoad scene) { switch (scene) { case SceneToLoad.BombDiffusal: SceneManager.LoadScene("Scenes/BombDiffusal"); return; case SceneToLoad.CarMinigame: SceneManager.LoadScene("Scenes/CarMinigame"); return; case SceneToLoad.FightScene: SceneManager.LoadScene("Scenes/FightScene"); return; case SceneToLoad.QTEScene: SceneManager.LoadScene("Scenes/QTEScene"); return; case SceneToLoad.SniperRunner: SceneManager.LoadScene("Scenes/SniperRunner"); return; } }
public void LoadIntro(SceneToLoad scene) { switch (scene) { case SceneToLoad.BombDiffusal: SceneManager.LoadScene("Scenes/IntroToBriefcase"); return; case SceneToLoad.CarMinigame: SceneManager.LoadScene("Scenes/IntroToCar"); return; case SceneToLoad.FightScene: SceneManager.LoadScene("Scenes/IntroToFight"); return; case SceneToLoad.QTEScene: SceneManager.LoadScene("Scenes/IntroToQTE"); return; case SceneToLoad.SniperRunner: SceneManager.LoadScene("Scenes/IntroToRunner"); return; } }
private static IEnumerator LoadSceneCoroutine(SceneToLoad scene) { yield return(new WaitForSeconds(1)); var task = SceneManager.LoadSceneAsync(scene.ToString()); while (!task.isDone) { yield return(null); } }
public static void LoadScene(SceneToLoad scene) { SceneManager.LoadScene((int)scene); }
void LoadScene() { scene = (SceneToLoad)scene_load; switch (scene) { case SceneToLoad.TUTORIAL: { SceneManager.LoadNewOclusionMap("Map_Level_Tutorial_oclusion"); SceneManager.LoadNewWalkableMap("Map_Level_Tutorial"); SceneManager.LoadScene("Tutorial Real Scene"); StatsScore.SoftReset(); break; } case SceneToLoad.ALPHA2_LEVEL_1_1: { SceneManager.LoadNewOclusionMap("Map_Level_1_1_oclusion"); SceneManager.LoadNewWalkableMap("Map_Level_1_1"); if (DifficultySelector.hard_mode == true) { SceneManager.LoadScene("Alpha2_Level_1_1_HARD"); } else { SceneManager.LoadScene("Alpha2_Level_1_1_EASY"); } StatsScore.SetDefinitiveScore(); StatsScore.SoftReset(); break; } case SceneToLoad.ALPHA2_LEVEL_1_2: { SceneManager.LoadNewOclusionMap("Map_Level_1_2_oclusion"); SceneManager.LoadNewWalkableMap("Map_Level_1_2"); if (DifficultySelector.hard_mode == true) { SceneManager.LoadScene("Alpha2_Level_1_2_HARD"); } else { SceneManager.LoadScene("Alpha2_Level_1_2_EASY"); } StatsScore.SetDefinitiveScore(); StatsScore.SoftReset(); break; } case SceneToLoad.ALPHA2_LEVEL_1_3: { SceneManager.LoadNewOclusionMap("Map_Level_1_3_oclusion"); SceneManager.LoadNewWalkableMap("Map_Level_1_3"); if (DifficultySelector.hard_mode == true) { SceneManager.LoadScene("Alpha2_Level_1_3_HARD"); } else { SceneManager.LoadScene("Alpha2_Level_1_3_EASY"); } StatsScore.SetDefinitiveScore(); StatsScore.SoftReset(); break; } case SceneToLoad.LVL2_ZONE1: { //SceneManager.LoadNewWalkableMap("LVL2_Zone1"); if (SceneManager.CheckMultiSceneReady()) { SceneManager.RemoveSecondaryScene(); } SceneManager.LoadScene("Lvl1_3ToLvl2_1"); StatsScore.SetDefinitiveScore(); StatsScore.SoftReset(); break; } case SceneToLoad.LVL2_ZONE2: { SceneManager.LoadNewOclusionMap("LVL2_Zone2_oclusion"); SceneManager.LoadNewWalkableMap("LVL2_Zone2"); if (DifficultySelector.hard_mode == true) { SceneManager.LoadScene("LVL2_Zone_2_HARD"); } else { SceneManager.LoadScene("LVL2_Zone_2_EASY"); } StatsScore.SetDefinitiveScore(); StatsScore.SoftReset(); break; } case SceneToLoad.LVL2_ZONE3: { SceneManager.LoadNewOclusionMap("LVL2_Zone3_oclusion"); SceneManager.LoadNewWalkableMap("LVL2_Zone3"); if (DifficultySelector.hard_mode == true) { SceneManager.LoadScene("LVL2_Zone_3_HARD"); } else { SceneManager.LoadScene("LVL2_Zone_3_EASY"); } StatsScore.SetDefinitiveScore(); StatsScore.SoftReset(); break; } } }