Ejemplo n.º 1
0
        /// <summary>
        /// Scene を読み込む
        /// </summary>
        private IEnumerator LoadWindowAndScreenEnumerator(
            string loadWindowPath,
            string loadScreenPath,
            object param,
            Action onComplete)
        {
            _currentOpenScene = GetCurrentSceneBase();

            if (CurrentWindowPath != loadWindowPath)
            {
                var onCloseScreen = _currentOpenScene.OnCloseScreenEnumerator();
                while (onCloseScreen.MoveNext())
                {
                    yield return(null);
                }

                var onOpenScene = _currentOpenScene.OnCloseWindowEnumerator();

                while (onOpenScene.MoveNext())
                {
                    yield return(null);
                }
            }

            if (CurrentScreenPath != loadScreenPath)
            {
                var onCloseScreen = _currentOpenScene.OnCloseScreenEnumerator();
                while (onCloseScreen.MoveNext())
                {
                    yield return(null);
                }
            }

            var onOpenWindow = _currentOpenScene.OnOpenWindowEnumerator(loadWindowPath, loadScreenPath, CurrentWindowPath, CurrentScreenPath);

            while (onOpenWindow.MoveNext())
            {
                yield return(null);
            }

            onComplete?.Invoke();
            _isLoadingScene = false;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Scene を読み込む
        /// </summary>
        private IEnumerator LoadWindowAndScreenEnumerator(string loadWindowPath, string loadScreenPath, object param, Action onComplete)
        {
            _currentOpenScene = GetCurrentSceneBase();

            if (CurrentWindowPath != loadWindowPath)
            {
                yield return(_mono.StartCoroutine(_currentOpenScene.OnCloseScreenEnumerator()));

                yield return(_mono.StartCoroutine(_currentOpenScene.OnCloseWindowEnumerator()));
            }

            if (CurrentScreenPath != loadScreenPath)
            {
                yield return(_mono.StartCoroutine(_currentOpenScene.OnCloseScreenEnumerator()));
            }

            yield return(_mono.StartCoroutine(_currentOpenScene.OnOpenWindowEnumerator(loadWindowPath, loadScreenPath, CurrentWindowPath, CurrentScreenPath)));

            onComplete?.Invoke();
            _isLoadingScene = false;
        }