예제 #1
0
    public void ShowCustomizePopup(PopupType _type, string title, string content, PopupShowType option = PopupShowType.ReplaceCurrent, Action onYes = null, Action onNo = null, Action other = null)
    {
        if (_type == PopupType.Ok || _type == PopupType.YesNo || _type == PopupType.Customize)
        {
            var _popup = (CustomizePopup)GetPopup(PopupType.Customize);

            if (_type == PopupType.Ok)
            {
                _popup.InitCustomizePopup(title, content, onYes);
            }
            else if (_type == PopupType.YesNo)
            {
                _popup.InitCustomizePopup(title, content, onYes, onNo);
            }

            else
            {
                _popup.InitCustomizePopup(title, content, onYes, onNo, other);
            }
            ShowPopup(_popup, option);
        }
        else
        {
            ShowPopup(_type, option);
            Debug.LogWarning("please use ShowPopup(PopupType type, PopupShowType option = PopupShowType.ReplaceCurrent),Not custom");
        }
    }
예제 #2
0
    public void ShowPopup(PopupBase popup, PopupShowType option = PopupShowType.ReplaceCurrent, Action onYes = null, Action onNo = null)
    {
        if (current != null)
        {
            if (option == PopupShowType.DontShowIfOthersShowing)
            {
                Destroy(popup.gameObject);
            }
            else if (option == PopupShowType.ReplaceCurrent)
            {
                current.OnClose();
            }
            else if (option == PopupShowType.Stack)
            {
                current.Hide();
            }
        }

        current = popup;
        if (option != PopupShowType.ShowPrevious)
        {
            current.assentCall = onYes;
            current.cancelCall = onNo;
            current.onOpened  += OnePopupOpened;
            current.onClosed  += OnePopupClosed;
            popups.Push(current);
        }

        current.OnShow();
        if (onOpened != null)
        {
            onOpened();
        }
    }
예제 #3
0
 public void ShowYesNoPopup(string title, string content,
                            PopupShowType option = PopupShowType.ReplaceCurrent, Action onYes = null, Action onNo = null)
 {
     ShowCustomizePopup(PopupType.YesNo, title, content, option, onYes, onNo);
 }
예제 #4
0
 public void ShowOk(string title, string content,
                    PopupShowType option = PopupShowType.ReplaceCurrent, Action onYes = null)
 {
     ShowCustomizePopup(PopupType.Ok, title, content, option, onYes);
 }
예제 #5
0
    public void ShowPopup(PopupType type, PopupShowType option = PopupShowType.ReplaceCurrent, Action onYes = null, Action onNo = null)
    {
        PopupBase dialog = GetPopup(type);

        ShowPopup(dialog, option, onYes, onNo);
    }
예제 #6
0
 public void ShowCustomizePopup(string title, string content, Action onYes, Action onNo,
                                PopupShowType option = PopupShowType.ReplaceCurrent)
 {
 }