Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AsyncOperation async;
- IEnumerator LoadNewScene(string stringZaladuj)
- {
- yield return new WaitForSeconds (3);
- async = Application.LoadLevelAsync(stringZaladuj);
- async.allowSceneActivation = false;
- while (async.progress < 0.9f)
- {
- yield return null;
- }
- Debug.Log ("the Game has been loaded");
- while(!Input.GetMouseButtonDown(0))
- {
- yield return null;
- }
- async.allowSceneActivation = true;
- }
- IEnumerator LoadNewScene(string sceneName)
- {
- AsyncOperation async;
- async = SceneManager.LoadSceneAsync(sceneName);
- while(!async.isDone)
- {
- Debug.Log(async.progress);
- float progress = Mathf.Clamp01(async.progress / .9f);
- loadingText.text = string.Format("Loading {0}%",async.progress * 100); //"Loading "+ (progress * 100) + "%";//
- yield return null;
- }
- }
Advertisement