private void ClosePopupByName(string popupName, bool internalCall) { temp_popups.Clear(); PopupProcess target = null; while (mPopups.Count > 0) { PopupProcess popup = mPopups.Pop(); if (popup.name == popupName) { target = popup; break; } temp_popups.Push(popup); } bool isTopClosed = true; while (temp_popups.Count > 0) { mPopups.Push(temp_popups.Pop()); isTopClosed = false; } if (target != null) { RemoveFocus(target, !internalCall); target.Close(isTopClosed); } if (isTopClosed && mPopups.Count > 0) { PopupProcess popup = mPopups.Peek(); if (!popup.visible) { popup.Show(); } } }
public void ClosePopup(GameObject popupObject) { temp_popups.Clear(); PopupProcess target = null; while (mPopups.Count > 0) { PopupProcess popup = mPopups.Pop(); if (popup.gameObject == popupObject) { target = popup; break; } temp_popups.Push(popup); } bool isTopClosed = true; while (temp_popups.Count > 0) { mPopups.Push(temp_popups.Pop()); isTopClosed = false; } if (target != null) { RemoveFocus(target, true); target.Close(isTopClosed); } if (isTopClosed && mPopups.Count > 0) { PopupProcess popup = mPopups.Peek(); if (!popup.visible) { popup.Show(); } } }