private void Start()
        {
            List <string> _scenesToAddList = new List <string>();

            if (_loadAudio)
            {
                _scenesToAddList.Add(Scenes.AUDIO);
            }

            if (_loadUI)
            {
                _scenesToAddList.Add(Scenes.UI);
            }

            if (_loadMain)
            {
                _scenesToAddList.Add(Scenes.MAIN);
            }

            if (_loadDebugUI)
            {
                _scenesToAddList.Add(Scenes.DEBUG_UI);
            }

            LoadSceneJob.All(out List <LoadSceneJob> jobList, _scenesToAddList.ToArray(), true);
        }
Ejemplo n.º 2
0
        // Function: TransitionIn
        // Fades into gameplay from the transition screen.
        // Think of it like a hide method.
        // If given a load scene job list, will
        public IEnumerator TransitionIn(List <LoadSceneJob> jobList = null)
        {
            if (jobList != null)
            {
                _progressBarUI.gameObject.SetActive(true);

                // while loading isn't done, update the progress bar
                while (LoadSceneJob.IsLoadingDoneAll(jobList) == false)
                {
                    _progressBarUI.SetValue(LoadSceneJob.ProgressAll(jobList));
                    yield return(null);
                }

                _progressBarUI.gameObject.SetActive(false);
            }

            // shows the game
            yield return(_transitionUI.TransitionIn());
        }