private void OnSceneTransitionStarted(BuildScenes?from, BuildScenes to) { StartCoroutine(Coroutines.FadeTo(_canvasGroup, 1, transitionTime, () => { SceneManager.LoadSceneAsync((int)to).completed += operation => StartCoroutine( Coroutines.FadeTo(_canvasGroup, 0, transitionTime, () => { _gameStateService.TriggerSceneTransitionFinished(); })); })); }
public void TriggerSceneTransition(BuildScenes to) { _buildSceneFrom = _currentBuildScene; _buildSceneTo = to; SceneTransitionStarted?.Invoke(_buildSceneFrom, _buildSceneTo); }