public void Init() { OnSceneLoadingStart?.Invoke(); Load(_sceneLoadingProcess); _sceneLoadingProcess.OnProgressSequence += (prog) => OnSceneLoadingProgress?.Invoke(prog); _sceneLoadingProcess.OnFinishSequence += () => OnSceneLoadingFinished?.Invoke(); _sceneLoadingProcess.Execute(); }
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())); }
public void LoadScene() { SetupSceneLoading(); _scheduleController.StartCoroutine(IE_LoadScene(() => OnSceneLoadingStart?.Invoke(), (prog) => OnSceneLoadingProgress?.Invoke(prog), () => OnSceneLoadingFinished?.Invoke())); }