Update AssetBundleBuilder

This commit is contained in:
hevinci
2022-03-18 11:25:07 +08:00
parent 8ee06ccf76
commit 512093b0ba
6 changed files with 49 additions and 13 deletions
@@ -30,6 +30,14 @@ namespace YooAsset.Editor
UnityEngine.Debug.Log($"拷贝Readme文件到:{destPath}");
}
// 拷贝Report文件
{
string sourcePath = $"{buildParameters.PipelineOutputDirectory}/{ResourceSettingData.Setting.ReportFileName}";
string destPath = $"{packageDirectory}/{ResourceSettingData.Setting.ReportFileName}";
EditorTools.CopyFile(sourcePath, destPath, true);
UnityEngine.Debug.Log($"拷贝Report文件到:{destPath}");
}
// 拷贝PatchManifest文件
{
string sourcePath = $"{buildParameters.PipelineOutputDirectory}/{ResourceSettingData.Setting.PatchManifestFileName}";
@@ -77,9 +77,9 @@ namespace YooAsset.Editor
AppendData(content, "");
AppendData(content, $"--冗余列表--");
for (int i = 0; i < buildMapContext.RedundancyList.Count; i++)
for (int i = 0; i < buildMapContext.RedundancyAssetList.Count; i++)
{
string redundancyAssetPath = buildMapContext.RedundancyList[i];
string redundancyAssetPath = buildMapContext.RedundancyAssetList[i];
AppendData(content, redundancyAssetPath);
}
@@ -67,6 +67,9 @@ namespace YooAsset.Editor
buildReport.BundleInfos.Add(reportBundleInfo);
}
// 冗余资源列表
buildReport.RedundancyAssetList = buildMapContext.RedundancyAssetList;
// 删除旧文件
string filePath = $"{buildParameters.PipelineOutputDirectory}/{ResourceSettingData.Setting.ReportFileName}";
if (File.Exists(filePath))
@@ -19,7 +19,7 @@ namespace YooAsset.Editor
/// <summary>
/// 冗余的资源列表
/// </summary>
public readonly List<string> RedundancyList = new List<string>(1000);
public readonly List<string> RedundancyAssetList = new List<string>(1000);
/// <summary>
@@ -201,7 +201,7 @@ namespace YooAsset.Editor
if(redundancy.Check(buildAssetInfo.AssetPath))
{
undependentAssets.Add(buildAssetInfo);
buildMapContext.RedundancyList.Add(buildAssetInfo.AssetPath);
buildMapContext.RedundancyAssetList.Add(buildAssetInfo.AssetPath);
continue;
}
}
@@ -212,7 +212,7 @@ namespace YooAsset.Editor
if (AssetBundleCollectorSettingData.HasCollector(buildAssetInfo.AssetPath) == false)
{
undependentAssets.Add(buildAssetInfo);
buildMapContext.RedundancyList.Add(buildAssetInfo.AssetPath);
buildMapContext.RedundancyAssetList.Add(buildAssetInfo.AssetPath);
}
}
}