Esempio n. 1
0
        public void onPopupClosed(popupBase sender, popupClosedEventArgs e)
        {
            popupClosedEventHandler handler = popupClosed;

            if (handler != null)
            {
                handler(sender, e);
            }
        }
Esempio n. 2
0
    private void ShowInPopupList()
    {
        popupBase showingPopup = popupList.Peek();

        textTitle.text = showingPopup.title;
        textDesc.text  = showingPopup.desc;

        this.transform.localPosition = Vector3.zero;

        SoundManager.PlayOneShotSound(SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_select], SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_select].clip);
    }
Esempio n. 3
0
    public void OnClickClose()
    {
        popupBase closePopup = popupList.Dequeue();

        closePopup.closeCallback?.Invoke();

        if (popupList.Count > 0)
        {
            // if popup exist
            ShowInPopupList();
        }
        else
        {
            SoundManager.PlayOneShotSound(SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_select], SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_select].clip);
            this.transform.localPosition = new Vector3(hideXAxis, 0, 0);
        }
    }
Esempio n. 4
0
    public void ShowPopup(string title, string desc, Action closeCallback = null)
    {
        if (popupList == null)
        {
            popupList = new Queue <popupBase>();
        }

        popupBase newPopup = new popupBase();

        newPopup.title         = title;
        newPopup.desc          = desc;
        newPopup.closeCallback = closeCallback;

        popupList.Enqueue(newPopup);

        if (popupList.Count == 1)
        {
            ShowInPopupList();
        }
    }