public bool ShowPopup(BasePopup.TypeOfPopup type, string message = null, BaseSlot slot = null) { if (PopupList.ContainsKey(type.ToString())) { return(PopupList[type.ToString()]); } bool check = InitPopup(type); return(check); }
public void InitPopup(BasePopup.TypeOfPopup type) { UpdateContainer(); BasePopup popupNeed = popupDictionaries[type.ToString()]; if (popupNeed == null) { return; } GameObject obj = Instantiate(popupNeed.gameObject, container); BasePopup popup = obj.GetComponent <BasePopup>(); if (popup != null) { popup.ShowPopup(); } }
public bool InitPopup(BasePopup.TypeOfPopup type) { UpdateContainer(); BasePopup popupNeed = Resources.Load <BasePopup>("Popup/" + type.ToString()); if (popupNeed == null) { return(false); } GameObject obj = Instantiate(popupNeed.gameObject, container); BasePopup popup = obj.GetComponent <BasePopup>(); if (popup != null) { PopupList.Add(popup.type.ToString(), popup); popup.transform.SetAsLastSibling(); popup.ShowPopup(); return(true); } return(false); }