예제 #1
0
 public static void LoadScene(string sceneToLoad)
 {
     Timeout.StopTimers();
     Timeout.Instance.StopAllCoroutines();
     CanvasList.ResetIndex();
     StopAudio(Sound.CurrentPlayingSound);
     if (sceneToLoad.ToLower().Contains("mainmenu"))
     {
         CityInitializer.City.SetActive(false);
         StopAudio(CityInitializer.City.GetComponent <AudioSource>());
     }
     if (sceneToLoad.ToLower().Contains("minigame") && !Application.loadedLevelName.ToLower().Contains("minigame"))
     {
         CityInitializer.City.SetActive(false);
         StopAudio(CityInitializer.City.GetComponent <AudioSource>());
         var sceneName = Application.loadedLevelName;
         sceneFilters.ForEach(f => sceneName = sceneName.Replace(f, ""));
         if (!Scenes.CompletedScenes.Contains(sceneName) && !Scenes.LoadingSceneThroughDebugging)
         {
             Scenes.CompletedScenes.Add(sceneName);
         }
     }
     Scenes.LoadingSceneThroughDebugging = false;
     GameObject.Find("LoadingIndicatorCanvas").GetComponent <Canvas>().enabled = true;
     if (sceneToLoad != "")
     {
         Timeout.Instance.StartCoroutine(loadLevelAsync(sceneToLoad));
     }
 }