private static void UpdatePopupStack(UIPopup newPopup = null) { if (newPopup != null) { newPopup.transform.SetParent(Instance._popupLayer, false); Instance._popupStack.Push(newPopup); } else { var oldPopup = Instance._popupStack.Pop(); Destroy(oldPopup.gameObject); } foreach (var popup in Instance._popupStack) { popup.SetVisible(false); } if (ActivePopup != null) { ActivePopup.SetVisible(true); ActivePopup.Activate(); Scrimmer.ScrimOver(Instance._popupLayer); } else { Scrimmer.ClearScrim(Instance._popupLayer); } }
private static UIPopup GetPopup(Type type) { var selectedPopup = CreatePopup(type); UpdatePopupStack(selectedPopup); if (selectedPopup.UseScrim) { Scrimmer.ScrimOver(Instance._popupLayer); } return(selectedPopup); }