public bool ShowPopupWithNoData(PopupType type, string _message = null, Action noCallBack = null, Action yesCallBack = null) { if (PopupList.ContainsKey(type.ToString())) { BasePopupSimple popup = PopupList[type.ToString()]; if (popup != null) { popup.SetupData(_message, noCallBack, yesCallBack); popup.transform.SetAsLastSibling(); popup.OnShow(); return(true); } return(false); } bool check = InitPopup(type, _message, noCallBack, yesCallBack); return(check); }
public bool ShowPopupWithData <T>(PopupType type, T slot = default, List <T> slots = null, string message = null, Action noCallBack = null, Action yesCallBack = null) { if (PopupList.ContainsKey(type.ToString())) { BasePopupSimple popup = PopupList[type.ToString()]; if (popup != null) { BasePopup <T> _popup = popup as BasePopup <T>; _popup.SetupData(slot, slots, message, noCallBack, yesCallBack); _popup.transform.SetAsLastSibling(); _popup.OnShow(); return(true); } return(false); } bool check = InitPopup(type, slot, slots, message, noCallBack, yesCallBack); return(check); }
private bool InitPopup(PopupType type, string message = null, Action noCallBack = null, Action yesCallBack = null) { // UpdateContainer(); BasePopupSimple popupPrefab = Resources.Load <BasePopupSimple>(string.Format(ResourcesConstant.POPUP_PATH, type.ToString())); if (popupPrefab == null) { return(false); } BasePopupSimple popup = GameMgr.Ins.InstantiateHelper(popupPrefab); PopupList.Add(popup.type.ToString(), popup); if (popup != null) { popup.SetupData(message, noCallBack, yesCallBack); popup.transform.SetAsLastSibling(); popup.OnShow(); return(true); } return(false); }