public static AssetBundleCollector CollectAssetBundlesForFolder(GameResType type, string path, string pattern, string assetbundlename, SearchOption searchOption = SearchOption.AllDirectories)
        {
            AssetCollector          collector            = AssetCollector.CreateAndCollect(path, pattern, type, searchOption);
            List <AssetBundleBuild> buildList            = new List <AssetBundleBuild>();
            AssetBundleCollector    assetbundleCollector = new AssetBundleCollector();

            assetbundleCollector.AddBuilder(assetbundlename, collector);
            return(assetbundleCollector);
        }
 public void AddBuilder(string assetbundleName, AssetCollector collector)
 {
     if (collector.IsEmpty())
     {
         return;
     }
     AddBuilder(assetbundleName, collector.ToAssetStringList());
     collector.UpdateGameTable(assetbundleName);
     collector.Reset();
 }
        public static AssetCollector CreateAndCollect(string path, string pattern, GameResType type, SearchOption searchOption)
        {
            string         systemFullPath = PathUtil.GetFullPath(path);
            AssetCollector collector      = new AssetCollector();

            if (!Directory.Exists(systemFullPath))
            {
                return(collector);
            }
            collector.CollectFolder(systemFullPath, pattern, type, searchOption);
            return(collector);
        }
        public static AssetBundleCollector CollectAssetbundlesForEachFile(GameResType type, string path, string pattern, string format = "{0}", SearchOption searchOption = SearchOption.AllDirectories)
        {
            AssetCollector       collector            = AssetCollector.CreateAndCollect(path, pattern, type, searchOption);
            AssetBundleCollector assetbundleCollector = new AssetBundleCollector();

            if (collector == null)
            {
                return(assetbundleCollector);
            }
            assetbundleCollector.AddBuilderList(format, collector);
            return(assetbundleCollector);
        }
        public void AddBuilderList(string nameFormat, AssetCollector collector)
        {
            List <BuildAssetInfo> list = collector.GetBuildAssetInfoList();

            for (int i = 0; i < list.Count; ++i)
            {
                string[] s = PathUtil.splitePath(list[i].resPath);
                string   assetbundleName = string.Format(nameFormat, s);
                AddBuilder(assetbundleName, new string[1] {
                    list[i].resPath
                });
                list[i].UpdateGameRes(assetbundleName);
            }
            collector.Reset();
        }
 public void CollectAppend(AssetBundleCollector mainCollector, BuildOption option, GameResType resType, string path, string pattern, string assetbundleName, bool independent, SearchOption searchOption = SearchOption.AllDirectories)
 {
     for (int i = 0; i < mainCollector.buildList.Count; ++i)
     {
         AssetBundleBuild bd         = mainCollector.buildList[i];
         string           name       = PathUtil.GetFileNameWithoutExtension(bd.assetBundleName);
         string           formatPath = string.Format(path, name);
         if (independent)
         {
             Collect(option, resType, formatPath, pattern, assetbundleName);
         }
         else
         {
             AssetCollector collector  = AssetCollector.CreateAndCollect(formatPath, pattern, resType, searchOption);
             List <string>  assetList  = new List <string>(bd.assetNames);
             List <string>  assetList2 = new List <string>(collector.ToAssetStringList());
             assetList.AddRange(assetList2);
             bd.assetNames = assetList.ToArray();
             mainCollector.buildList[i] = bd;
             collector.UpdateGameTable(bd.assetBundleName);
         }
     }
 }