예제 #1
0
        IEnumerator Loader(string levelName)
        {
            AsyncOperation async = Application.LoadLevelAsync(levelName);

            while (!async.isDone)
            {
                if (lvlLoadingDone)
                {
                    b.Value = 0.6f + (async.progress) * 0.4f;
                }
                yield return(async.isDone);

                //LoadingBar.setValue(async.progress);
                //Debug.Log("Loading at " + async.progress);
                yield return(new WaitForEndOfFrame());
            }

            //Debug.Log("Completed Loading of :: " + levelName);
            if (lvlLoadingDone)
            {
                Destroy(gameObject);
            }
            else
            {
                lvlLoadingDone = true;
                b = FindObjectOfType <SegmentedBar>();
            }
        }
예제 #2
0
파일: LoadObject.cs 프로젝트: nolimet/Liaka
        IEnumerator Loader(string levelName)
        {
            AsyncOperation async = Application.LoadLevelAsync(levelName);
            while (!async.isDone)
            {
                if (lvlLoadingDone)
                    b.Value = 0.6f + (async.progress) * 0.4f;
                yield return async.isDone;
                //LoadingBar.setValue(async.progress);
                //Debug.Log("Loading at " + async.progress);
                yield return new WaitForEndOfFrame();
            }

            //Debug.Log("Completed Loading of :: " + levelName);
            if (lvlLoadingDone)
                Destroy(gameObject);
            else
            {
                lvlLoadingDone = true;
                b = FindObjectOfType<SegmentedBar>();
            }
        }