Esempio n. 1
0
        public void Show(PopupView popup)
        {
            // DebugUtils.Log("PopupManagerView.Show()");
            OnPreShow(popup);

            for (int i = 0; i < recentPopups.Length; ++i)
            {
                if (recentPopups[i] == popup)
                {
                    recentPopups[i] = null;
                    break;
                }
            }

            PopupView recentPopup = recentPopups[nextPopupIndex];

            if (recentPopup != null)
            {
                recentPopup.GetComponent <ShowableView>().Hide();
            }

            recentPopups[nextPopupIndex] = popup;
            ++nextPopupIndex;

            if (nextPopupIndex >= recentPopups.Length)
            {
                nextPopupIndex = 0;
            }

            var showable = popup.GetComponent <ShowableView>();

            DebugUtils.Assert(!showable.IsShown);
            showable.OnHide += OnPopupHide;
            showable.Show();
        }
Esempio n. 2
0
        public PopupView Get(int popupType)
        {
            PopupView popupProto = popupProtos[popupType];
            int       poolId     = popupProto.GetComponent <PoolableView>().PoolId;

            return(poolStorage.Take(poolId)
                   .GetComponent <PopupView>());
        }