Exemple #1
0
        /// <summary>
        /// Window を開く
        /// </summary>
        public IEnumerator OnOpenWindowEnumerator(string nextWindowPath, string nextScreenPath,
                                                  string currentWindowPath, string currentScreenPath)
        {
            if (currentWindowPath != nextWindowPath)
            {
                if (!_windowBaseList.ContainsKey(nextWindowPath) || _windowBaseList[nextWindowPath] == null)
                {
                    var        loaded = false;
                    GameObject prefab = null;
                    ClioneResourceLoader.LoadAsync <GameObject>(nextWindowPath,
                                                                uiParts =>
                    {
                        prefab = uiParts;
                        loaded = true;
                    },
                                                                () =>
                    {
                        Debug.LogError($"{nextWindowPath} is not found.");
                        loaded = true;
                    });

                    while (!loaded)
                    {
                        yield return(null);
                    }

                    _windowBaseList.Add(nextWindowPath, Instantiate(prefab, _windowRootTransform).GetComponent <WindowBase>());
                    var initialize = _windowBaseList[nextWindowPath].InitializeEnumerator();
                    while (initialize.MoveNext())
                    {
                        yield return(null);
                    }
                }

                _currentOpenWindow = _windowBaseList[nextWindowPath].GetComponent <WindowBase>();
                _currentOpenWindow.gameObject.SetActive(true);
                _currentOpenWindow.SetWindowPath(nextWindowPath);
            }

            var onBeforeOpen = _currentOpenWindow.OnBeforeOpenWindowEnumerator();

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

            var onOpen = _currentOpenWindow.OnOpenWindowEnumerator(nextScreenPath, currentScreenPath);

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

            var onAfterOpen = _currentOpenWindow.OnAfterOpenWindowEnumerator();

            while (onAfterOpen.MoveNext())
            {
                yield return(null);
            }
        }
Exemple #2
0
        /// <summary>
        /// Show Target DrillDownView
        /// </summary>
        private IEnumerator ShowEnumerator(string drillDownPath, object param, Action onComplete)
        {
            var        loaded = false;
            GameObject prefab = null;

            ClioneResourceLoader.LoadAsync <GameObject>(drillDownPath,
                                                        uiParts =>
            {
                prefab = uiParts;
                loaded = true;
            },
                                                        () =>
            {
                Debug.LogError($"{drillDownPath} is not found.");
                loaded = true;
            });

            while (!loaded)
            {
                yield return(null);
            }

            var drillDownViewer = UnityEngine.Object.Instantiate(prefab, _parent).GetComponent <DrillDownViewerBase>();

            if (_drillDownViewerList.Count != 0)
            {
                var currentViewer = _drillDownViewerList.Peek();
                currentViewer.Next(true);
            }

            _drillDownViewerList.Push(drillDownViewer);
            drillDownViewer.Initialize(param, this);
            drillDownViewer.Show(onComplete);
        }
Exemple #3
0
        private ClioneCore(IResourceLoader loader)
        {
            var gameObject = new GameObject {
                name = GameObjectName
            };

            Object.DontDestroyOnLoad(gameObject);
            _clioneDispatcher = gameObject.AddComponent <ClioneDispatcher>();
            ClioneResourceLoader.Initialize(loader);
        }