Esempio n. 1
0
    private IEnumerator AsyncLoading(string level)
    {
        // ... Show Screen.
        showPanels.ShowLoadingPanel();

//		int loadProgress = 0;
        progressbar.size = 0;
        receiverProgress.UnComplete();

        AsyncOperation async;

        async = Application.LoadLevelAsync(level);

//		if (typeof(int).Equals(((int) level).GetType()))
//			async = Application.LoadLevelAsync((int) level);
//		else
//			async = Application.LoadLevelAsync((string) level);

        while (!async.isDone)
        {
            // ... Progress Screen.
//			loadProgress = (int) (async.progress * 100);
            progressbar.size = async.progress;

            if ((int)(async.progress * 100) > 95)
            {
                receiverProgress.Complete();
            }

            yield return(null);
        }

        if (!inMainMenu)
        {
            PuzzleManager.puzzleToPlay = m_levelToPlay;
            gameTimer.Start();
            hintScript.Start();
//			PuzzleManager.current.PlayPuzzle(PuzzleManager.puzzleToPlay);
        }

        if (m_bThanksPanel)
        {
            showPanels.HideMenu();
        }

        // ... Hide Screen.
        showPanels.HideLoadingPanel();
        animColorFade.SetTrigger("fadeOut");
    }