Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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();
            }
        }
    }
Esempio n. 4
0
    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);
    }
Esempio n. 5
0
    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();
        }
    }
Esempio n. 6
0
    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);
    }
Esempio n. 7
0
 public BasePopup GetPopup(BasePopup.TypeOfPopup type)
 {
     return(null);
 }