/// <summary> /// 返回Key为资源Path,Value为该资源所在的BundlePath字典 /// </summary> /// <param name="splitPathListListDict"></param> private static Dictionary <string, string> BuildAssets(Dictionary <string, List <List <string> > > splitPathListListDict) { Dictionary <string, string> result = new Dictionary <string, string>(); foreach (string entryPath in splitPathListListDict.Keys) { List <List <string> > assetPathListList = splitPathListListDict[entryPath]; List <StrategyNode> nodeList = AssetBuildStrategyManager.GetAssetBuildStrategy(entryPath).nodeList; HashSet <string> bundlePathSet = new HashSet <string>(); for (int i = 0; i < assetPathListList.Count; i++) { Dictionary <string, string> bundlePathDict = AssetBundleBuilder.Add(entryPath, assetPathListList[i], nodeList[i]); foreach (string k in bundlePathDict.Keys) { string path = ReplaceTemparyPath(k); if (result.ContainsKey(path) == false) { result.Add(path, bundlePathDict[k]); } bundlePathSet.Add(bundlePathDict[k]); } } AssetRecordHelper.RecordAssetDependency(entryPath, bundlePathSet.ToList <string>()); } AssetBundleBuilder.Build(); return(result); }
private static void Initialize() { TemporaryAssetHelper.Initialize(); MaterialJsonData.Initialize(); AssetBuildStrategyManager.Initialize(); AssetBundleBuilder.Initialize(); AssetRecordHelper.ReadAssetRecord(); Logger.GetLogger(LOGGER_NAME).Level = Logger.LEVEL_LOG; _processedAssetPathSet = new HashSet <string>(); }
private static void BuildAssets(List <string> selectedPathList) { //获取资源分离后的路径 Dictionary <string, List <List <string> > > splitPathListListDict = GetSplitPathListListDict(selectedPathList); AssetDatabase.SaveAssets(); BuildAssets(splitPathListListDict); AssetRecordHelper.WriteAssetRecord(); AssetBundleBuilder.BuildAssetRecord(); //TemporaryAssetHelper.DeleteAllTempAsset(); if (AssetBuildStrategyManager.isSaveUIMediate == false) { UIPrefabProcessor.DeleteMediate(); } AssetBundleBuilder.LogBuildResult(); }