Esempio n. 1
0
    private T CreatePopupUI <T>(string folder, UIPopupBase.PopupType type = UIPopupBase.PopupType.POP_UP, bool preOption = false) where T : UIPopupBase
    {
        // SpriteLoad;

        if (type == UIPopupBase.PopupType.FRONT)
        {
            if (_frontPopup)
            {
                _accFrontUI++;
                return(null);
            }
        }

        T bundlePopup = null;

        bundlePopup = GetPoolUI <T>();

        if (bundlePopup == null)
        {
            GameObject res = Resources.Load <GameObject>(GlobalUtil.AddString("Prefab/UI/Popup/", typeof(T).ToString()));

            if (res == null)
            {
                Debug.LogError("Look for Other Resources Path : " + typeof(T).ToString());
                return(null);
            }

            GameObject obj = Instantiate(res);

            bundlePopup = obj.GetComponent <T>();
        }

        selectParentBelongtoUI(bundlePopup, type, preOption);


        _datamanager.AddData <T>();


        return(bundlePopup as T);
    }