Пример #1
0
    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;
    }
Пример #2
0
 public void Hide(PopupID id)
 {
     if (id == PopupID.Null)
     {
         return;
     }
     GetPopupById(id).Hide();
 }
Пример #3
0
    private Popup GetPopupById(PopupID id)
    {
        for (int i = 0; i < Popups.Count; i++)
        {
            if (Popups[i].ID == id)
            {
                return(Popups[i].Popup);
            }
        }

        return(null);
    }