예제 #1
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);
    }
예제 #2
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();
        }
    }
예제 #3
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);
    }