Пример #1
0
        internal AssetBundleLoader CreateLoader(string path)
        {
            path = path.ToLower();

            AssetBundleLoader loader = null;

            if (_loaderCache.ContainsKey(path))
            {
                loader = _loaderCache[path];
            }
            else
            {
#if !AB_MODE && UNITY_EDITOR
                loader = this.CreateLoader();
                loader.bundleManager = this;
                loader.bundleName    = path;
#else
                AssetBundleData data = _depInfoReader.GetAssetBundleInfo(path);
                if (data == null)
                {
                    return(null);
                }
                loader = this.CreateLoader();
                loader.bundleManager = this;
                loader.bundleData    = data;
                loader.bundleName    = data.fullName;
#endif
                _loaderCache[path] = loader;
            }

            return(loader);
        }
    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)
            {
                Debug.Log("MIssLoad:" + oriName);
                MissAssetBundleLoader missLoader = new MissAssetBundleLoader();
                missLoader.bundleManager = this;
                return(missLoader);
            }

            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
 private bool Exist(uint hash)
 {
     return(depInfoReader.GetAssetBundleInfo(hash) != null);
 }