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"); } }
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(); } }
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); }
public void ShowOk(string title, string content, PopupShowType option = PopupShowType.ReplaceCurrent, Action onYes = null) { ShowCustomizePopup(PopupType.Ok, title, content, option, onYes); }
public void ShowPopup(PopupType type, PopupShowType option = PopupShowType.ReplaceCurrent, Action onYes = null, Action onNo = null) { PopupBase dialog = GetPopup(type); ShowPopup(dialog, option, onYes, onNo); }
public void ShowCustomizePopup(string title, string content, Action onYes, Action onNo, PopupShowType option = PopupShowType.ReplaceCurrent) { }