Ejemplo n.º 1
0
    private static UIAtlas CreateAtlas(BUNDLELIST bundleList, string aAtlasPath, string aPrefabName)
    {
#if ASSET_BUNDLE
        GameObject bundleObj = ResourceBundle.intance.ResourceObject(bundleList, aPrefabName, typeof(GameObject)) as GameObject;
        if (bundleObj == null)
        {
#if DEBUG_LOG
            Debug.LogError(string.Format(" === ERROR ATALS {0} PREFAB NAME = {1}", bundleList.ToString(), aPrefabName));
#endif
            return(null);
        }

        UIAtlas atlas = bundleObj.GetComponent <UIAtlas>();
        if (atlas == null)
        {
#if DEBUG_LOG
            Debug.LogError("=== ATLAS NULL");
#endif
            return(null);
        }

        return(atlas);
#else
        return(Resources.Load(ResourcePathInfo.intance.GetResourcePathInfo(bundleList, string.Format("{0}{1}", aAtlasPath, aPrefabName)), typeof(UIAtlas)) as UIAtlas);
#endif
    }
Ejemplo n.º 2
0
    // 스프라이트 로딩.
    public static Sprite CreateSprite(BUNDLELIST bundleList, string aSPriteName)
    {
#if ASSET_BUNDLE
        Sprite resultSpr = ResourceBundle.intance.ResourceObject(bundleList, aSPriteName, typeof(Sprite)) as Sprite;
#else
        Sprite resultSpr = Resources.Load(ResourcePathInfo.intance.GetResourcePathInfo(bundleList, aSPriteName), typeof(Sprite)) as Sprite;
#endif

        return(resultSpr);
    }
Ejemplo n.º 3
0
    public static T CreatePrefab <T>(BUNDLELIST bundleList, Transform aParentTrs, string aPrefabName, SetTransformType TransformType = SetTransformType.OriginValue)
    {
        GameObject resultObj = CreatePrefab(bundleList, aParentTrs, aPrefabName, TransformType);

        if (resultObj == null)
        {
            return(default(T));
        }

        return(resultObj.GetComponent <T>());
    }
Ejemplo n.º 4
0
    // Instantiate 하지 않은 프리팹로딩.
    public static GameObject CreateDefaultPrefab(BUNDLELIST bundleList, string aPrefabName)
    {
#if ASSET_BUNDLE
        GameObject resultObj = ResourceBundle.intance.ResourceObject(bundleList, aPrefabName, typeof(GameObject)) as GameObject;
#else
        GameObject resultObj = Resources.Load(ResourcePathInfo.intance.GetResourcePathInfo(bundleList, aPrefabName)) as GameObject;
#endif
        if (resultObj == null)
        {
#if DEBUG_LOG
            Debug.LogError(string.Format(" === ERR CreateDefaultPrefab BUNDLE NAME {0} PREFAB NAME{1}", bundleList.ToString(), aPrefabName));
#endif
            return(null);
        }

#if ASSET_BUNDLE
        ReLinkAtlas(resultObj);
#endif

        return(resultObj);
    }
Ejemplo n.º 5
0
    //==================================================================================
    //
    // 에셋 번들 로드
    //
    //==================================================================================
    public static GameObject CreatePrefab(BUNDLELIST bundleList, Transform aParentTrs, string aPrefabName, SetTransformType TransformType = SetTransformType.OriginValue)
    {
#if ASSET_BUNDLE
        GameObject resultObj = ResourceBundle.intance.ResourceObject(bundleList, aPrefabName, typeof(GameObject)) as GameObject;
#else
        GameObject resultObj = Resources.Load(ResourcePathInfo.intance.GetResourcePathInfo(bundleList, aPrefabName)) as GameObject;
#endif
        if (resultObj == null)
        {
#if DEBUG_LOG
            Debug.LogError(string.Format("error CreatePrefab --- bundleList : {0}", bundleList.ToString()));
            Debug.LogError(string.Format("error CreatePrefab --- aParentTrs : {0}", aParentTrs.name));
            Debug.LogError(string.Format("error CreatePrefab --- aPrefabName : {0}", aPrefabName));
#endif
            return(null);
        }

        resultObj = InstantiateGameObject(resultObj, aParentTrs, TransformType, aPrefabName);

        return(resultObj);
    }