public void ShowPopup(BasePopup.TypeOfPopup type) { switch (type) { case BasePopup.TypeOfPopup.PO_ItemTooltip: if (ItemTooltipPopup.instance != null) { ItemTooltipPopup.instance.ShowPopup(); return; } break; case BasePopup.TypeOfPopup.PO_ForgingUpgrade: if (ForgingUpgradePopup.instance != null) { ForgingUpgradePopup.instance.ShowPopup(); return; } break; case BasePopup.TypeOfPopup.PO_Character: if (CharacterPopup.instance != null) { CharacterPopup.instance.ShowPopup(); return; } break; } InitPopup(type); }
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 HideAllPopup() { int count = Enum.GetValues(typeof(BasePopup.TypeOfPopup)).Length; for (int i = 0; i < count; i++) { BasePopup.TypeOfPopup type = (BasePopup.TypeOfPopup)i; BasePopup _popup = GetPopup(type); if (_popup != null) { _popup.HidePopup(); } } }
public BasePopup GetPopup(BasePopup.TypeOfPopup type) { switch (type) { case BasePopup.TypeOfPopup.PO_ItemTooltip: break; case BasePopup.TypeOfPopup.PO_ForgingUpgrade: break; case BasePopup.TypeOfPopup.PO_Character: break; } return(null); }
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); }
public BasePopup GetPopup(BasePopup.TypeOfPopup type) { return(null); }