GetAssetBundleInfo() public method

public GetAssetBundleInfo ( string fullName ) : AssetBundleData
fullName string
return AssetBundleData
示例#1
0
        /// <summary>
        /// 同步加载
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public AssetBundle Load(string path)
        {
#if _AB_MODE_
            AssetBundleData data       = _depInfoReader.GetAssetBundleInfo(HashUtil.Get(path.ToLower()) + ".ab");
            string          sourceFile = pathResolver.GetBundleSourceFile(data.fullName, false);
            var             ab         = AssetBundle.LoadFromFile(sourceFile);
            return(ab);
#else
            return(null);
#endif
        }
        internal AssetBundleLoader CreateLoader(string abFileName, string oriName = null)
        {
            AssetBundleLoader loader = null;

            if (_loaderCache.ContainsKey(abFileName))
            {
                loader = _loaderCache[abFileName];
            }
            else
            {
#if _AB_MODE_
                AssetBundleData data = _depInfoReader.GetAssetBundleInfo(abFileName);
                if (data == null && oriName != null)
                {
                    data = _depInfoReader.GetAssetBundleInfoByShortName(oriName.ToLower());
                }
                if (data == null)
                {
                    return(null);
                }

                loader = this.CreateLoader();
                loader.bundleManager = this;
                loader.bundleData    = data;
                loader.bundleName    = data.fullName;
#else
                loader = this.CreateLoader();
                loader.bundleManager = this;
                loader.bundleName    = abFileName;
#endif
                _loaderCache[abFileName] = loader;
            }

            return(loader);
        }
示例#3
0
        internal AssetBundleLoader CreateLoader(string abFileName, string oriName = null)
        {
            AssetBundleLoader loader = null;

            if (_loaderCache.ContainsKey(abFileName))
            {
                loader = _loaderCache[abFileName];
            }
            else
            {
#if _AB_MODE_
                AssetBundleData data = _depInfoReader.GetAssetBundleInfo(abFileName);
                if (data == null && oriName != null)
                {
                    data = _depInfoReader.GetAssetBundleInfo(oriName.ToLower());//todo: ab search path
                    if (data != null && _loaderCache.ContainsKey(data.bundleName))
                    {
                        return _loaderCache[data.bundleName];
                    }
                }
                if (data == null)
                {
                    MissAssetBundleLoader missLoader = new MissAssetBundleLoader();
                    missLoader.bundleManager = this;
                    return missLoader;
                }

                loader = this.CreateLoader();
                loader.bundleManager = this;
                loader.bundleData = data;
                loader.bundleName = data.bundleName;
#else
                loader = this.CreateLoader();
                loader.bundleManager = this;
                loader.bundleName = abFileName;
#endif
                _loaderCache[abFileName] = loader;
            }

            return loader;
        }