示例#1
0
    public bool Show(ScreenType type, Action <Transform> otherAnimation = null)
    {
        if (uiMainList.ContainsKey(type.ToString()))
        {
            BaseUIMain popup = uiMainList[type.ToString()];
            if (popup != null)
            {
                popup.transform.SetAsLastSibling();
                popup.SetData(otherAnimation);
                popup.OnShow();
                return(true);
            }
            return(false);
        }
        bool check = InitPopup(type, otherAnimation);

        return(check);
    }
示例#2
0
    private bool InitPopup(ScreenType type, Action <Transform> otherAnimation = null)
    {
        // UpdateContainer();
        string     path        = string.Format(ResourcesConstant.UI_MAIN_PATH, type.ToString());
        BaseUIMain popupPrefab = Resources.Load <BaseUIMain>(path);

        if (popupPrefab == null)
        {
            return(false);
        }
        BaseUIMain popup = GameMgr.Ins.InstantiateHelper(popupPrefab);

        uiMainList.Add(popup.type.ToString(), popup);
        if (popup != null)
        {
            popup.transform.SetAsLastSibling();
            popup.SetData(otherAnimation);
            popup.OnShow(true);
            return(true);
        }
        return(false);
    }