public PopupBase GetPopup(string loadingPopupName) { if (PopupDic.ContainsKey(loadingPopupName)) { return(PopupDic[loadingPopupName]); } return(null); }
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)); }
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); } } }
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(); } }
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)); }