public void SelectAB(string abName) { this.assets.Clear(); if (string.IsNullOrEmpty(abName)) { Reload(); return; } var assets = AssetMode.getABAssets(abName); int id = 0; foreach (var a in assets) { id++; AssetMode.AssetInfo assetInfo = new AssetMode.AssetInfo(id, a.address); //assetInfo.data = a; this.assets.Add(assetInfo); } Reload(); }
public static List <AssetBundleBuild> BuildSelect(string outPath, List <string> abs, BuildTarget target, BuildAssetBundleOptions options) { var needAdds = new List <AssetBundleBuild>(); foreach (var ab in abs) { List <ResInfoData> list = AssetMode.getABAssets(ab); if (list.Count > 0) { var bs = new AssetBundleBuild(); bs.assetBundleName = ab.ToLower(); bs.assetBundleVariant = "bytes"; List <string> assets = new List <string>(); foreach (var v in list) { if (!assets.Contains(v.path)) { assets.Add(v.path); } Debug.Log("abname:" + v.ABName + " /path:" + v.path); } bs.assetNames = assets.ToArray(); if (bs.assetNames.Length > 0) { needAdds.Add(bs); } } } if (!Directory.Exists(outPath)) { Directory.CreateDirectory(outPath); } BuildPipeline.BuildAssetBundles(outPath, needAdds.ToArray(), options, target); return(needAdds); }