public void Show(PopupID id, bool closeLastBefore = true) { EventManager.OnPopupOpened(); if (closeLastBefore && _lastId != PopupID.Null) { Hide(_lastId); } _lastId = id; _closing = false; if (!_showing) { _showing = true; DOTween.Kill("HidePopup"); } var p = GetPopupById(id); p.gameObject.SetActive(true); p.Show(); _popupActive = true; }
public void Hide(PopupID id) { if (id == PopupID.Null) { return; } GetPopupById(id).Hide(); }
private Popup GetPopupById(PopupID id) { for (int i = 0; i < Popups.Count; i++) { if (Popups[i].ID == id) { return(Popups[i].Popup); } } return(null); }