Пример #1
0
        public void Init()
        {
            OnSceneLoadingStart?.Invoke();
            Load(_sceneLoadingProcess);
            _sceneLoadingProcess.OnProgressSequence += (prog) => OnSceneLoadingProgress?.Invoke(prog);
            _sceneLoadingProcess.OnFinishSequence   += () => OnSceneLoadingFinished?.Invoke();

            _sceneLoadingProcess.Execute();
        }
Пример #2
0
        private IEnumerator IE_LoadScene(int sceneBuildIndex)
        {
            OnSceneLoadingStart?.Invoke();
            AsyncOperation asy = SceneManager.LoadSceneAsync(sceneBuildIndex, LoadSceneMode.Single);

            while (!asy.isDone)
            {
                OnSceneLoadingProgress?.Invoke(asy.progress / 2);
                yield return(null);
            }

            yield return(IE_LoadScene(() => { }, (prog) => OnSceneLoadingProgress?.Invoke(0.5f + prog / 2), () => OnSceneLoadingFinished?.Invoke()));
        }
Пример #3
0
 public void LoadScene()
 {
     SetupSceneLoading();
     _scheduleController.StartCoroutine(IE_LoadScene(() => OnSceneLoadingStart?.Invoke(), (prog) => OnSceneLoadingProgress?.Invoke(prog), () => OnSceneLoadingFinished?.Invoke()));
 }