internal static AssetLoaderBase CreateLoaderInternal(AssetBundleInfo bundleInfo)
        {
            // 如果加载器已经存在
            AssetLoaderBase loader = TryGetLoader(bundleInfo.BundleName);

            if (loader != null)
            {
                return(loader);
            }

            // 创建加载器
            if (SimulationOnEditor)
            {
                loader = new AssetDatabaseLoader(bundleInfo);
            }
            else
            {
                loader = new AssetBundleLoader(bundleInfo);
            }

            // 新增下载需求
            _loaders.Add(loader);
            return(loader);
        }
Exemple #2
0
 public AssetBundleProvider(AssetLoaderBase owner, string assetName, System.Type assetType)
     : base(owner, assetName, assetType)
 {
     _loader = owner as AssetBundleLoader;
 }