private IEnumerator LoadScene(AvailableScene newScene) { // Show panel _panel.SetActive(true); yield return(new WaitForSeconds(1f)); // Load I18N sentences yield return(StartCoroutine(I18NManager.Instance.ReloadSentences($"{newScene}Scene"))); Debug.Log("Loaded I18N sentences."); // Load scene (de-activated) var operation = SceneManager.LoadSceneAsync($"{newScene}Scene"); operation.allowSceneActivation = false; while (operation.progress < SceneLoadedPercentage) { _pb.Value = operation.progress; yield return(null); } // Activate scene _pb.Value = 1f; yield return(new WaitForSeconds(1f)); operation.allowSceneActivation = true; CurrentScene = newScene; }
public void ChangeScene(AvailableScene newScene) { StartCoroutine(LoadScene(newScene)); }