Exemple #1
0
        public PopupBase GetPopup(string loadingPopupName)
        {
            if (PopupDic.ContainsKey(loadingPopupName))
            {
                return(PopupDic[loadingPopupName]);
            }

            return(null);
        }
Exemple #2
0
        public void ShowPopup(string newPopupName, bool isQueued = false, bool isForceNotOnlyOne = false, float delay = 0.0f)
        {
            if (!IsInitialize())
            {
                PreInit();
            }

            if (!PopupDic.ContainsKey(newPopupName))
            {
                return;
            }

            if (isQueued)
            {
                if (showingPopupStack.Count > 0 || waitingPopupQueue.Count > 0)
                {
                    waitingPopupQueue.Enqueue(newPopupName);
                    return;
                }
            }
            else
            {
                // Overlap is blocked..
                if (showingPopupStack.Contains(newPopupName))
                {
                    return;
                }

                if (IsTransition && ignoreWhileTransition)
                {
                    return;
                }
            }

            if (IsIgnoreShowAllPopup)
            {
                return;
            }

            if (_showingRoutine != null)
            {
                StopCoroutine(_showingRoutine);
                _showingRoutine = null;
            }

            if (newPopupName == "LoadingPopup")
            {
                showingPopupStack.Push("LoadingPopup");
            }

            _showingRoutine = StartCoroutine(ShowPopupRoutine(newPopupName, isForceNotOnlyOne, delay));
        }
Exemple #3
0
        public void FindChildPopups()
        {
            if (popupRoot == null)
            {
                Debug.LogError("[Banana] PopupRoot is Null!!");
                return;
            }

            for (var i = 0; i < popupRoot.childCount; ++i)
            {
                var child = popupRoot.GetChild(i).GetComponent <PopupBase>();
                if (child != null)
                {
                    PopupDic.Add(child.name, child);
                }
            }
        }
Exemple #4
0
        private void FindChildPopups()
        {
            foreach (var popupRoot in _popupRoots)
            {
                for (var i = 0; i < popupRoot.childCount; ++i)
                {
                    var child = popupRoot.GetChild(i).GetComponent <PopupBase>();
                    if (child != null)
                    {
                        PopupDic.Add(child.name, child);

                        child.gameObject.SetActive(true);
                        child.PreInit(popupRoot, _settings.dimmingTime);
                    }
                }

                popupRoot.GetComponent <CanvasScaler>().matchWidthOrHeight = DeviceUtil.GetScaleMatch();
            }
        }
Exemple #5
0
        public void ShowPopup(string newPopupName, bool isQueued = false)
        {
            if (!IsInitialize())
            {
                PreInit();
            }

            if (!PopupDic.ContainsKey(newPopupName))
            {
                return;
            }

            if (isQueued)
            {
                if (showingPopupStack.Count > 0 || waitingPopupQueue.Count > 0)
                {
                    waitingPopupQueue.Enqueue(newPopupName);
                    return;
                }
            }
            else
            {
                // Overlap is blocked..
                if (showingPopupStack.Contains(newPopupName))
                {
                    return;
                }

                if (IsTransition && ignoreWhileTransition)
                {
                    return;
                }
            }

            if (_showingRoutine != null)
            {
                StopCoroutine(_showingRoutine);
                _showingRoutine = null;
            }

            _showingRoutine = StartCoroutine(ShowPopupRoutine(newPopupName));
        }