mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-30 13:38:46 +00:00
feat : the build report file add independ asset info
This commit is contained in:
@@ -107,8 +107,9 @@ namespace YooAsset.Editor
|
||||
buildReport.BundleInfos.Add(reportBundleInfo);
|
||||
}
|
||||
|
||||
// 冗余资源列表
|
||||
// 资源列表
|
||||
buildReport.RedundancyAssets = new List<ReportRedundancyAsset>(buildMapContext.RedundancyInfos);
|
||||
buildReport.IndependAssets = new List<ReportIndependAsset>(buildMapContext.IndependAssets);
|
||||
|
||||
// 序列化文件
|
||||
string fileName = YooAssetSettingsData.GetReportFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
||||
|
||||
@@ -107,11 +107,13 @@ namespace YooAsset.Editor
|
||||
{
|
||||
if (buildAssetInfo.IsRedundancyAsset())
|
||||
{
|
||||
var redundancyInfo = new ReportRedundancyAsset();
|
||||
redundancyInfo.AssetInfo = buildAssetInfo.AssetInfo;
|
||||
redundancyInfo.FileSize = FileUtility.GetFileSize(buildAssetInfo.AssetInfo.AssetPath);
|
||||
redundancyInfo.Number = buildAssetInfo.GetReferenceBundleCount();
|
||||
context.RedundancyInfos.Add(redundancyInfo);
|
||||
var redundancyAsset = new ReportRedundancyAsset();
|
||||
redundancyAsset.AssetPath = buildAssetInfo.AssetInfo.AssetPath;
|
||||
redundancyAsset.AssetGUID = buildAssetInfo.AssetInfo.AssetGUID;
|
||||
redundancyAsset.AssetType = buildAssetInfo.AssetInfo.AssetType.ToString();
|
||||
redundancyAsset.FileSize = FileUtility.GetFileSize(buildAssetInfo.AssetInfo.AssetPath);
|
||||
redundancyAsset.Number = buildAssetInfo.GetReferenceBundleCount();
|
||||
context.RedundancyInfos.Add(redundancyAsset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +181,14 @@ namespace YooAsset.Editor
|
||||
{
|
||||
string warning = BuildLogger.GetErrorMessage(ErrorCode.FoundUndependedAsset, $"Found undepended asset and remove it : {removeValue.AssetInfo.AssetPath}");
|
||||
BuildLogger.Warning(warning);
|
||||
context.UndependAssets.Add(removeValue.AssetInfo);
|
||||
|
||||
var independAsset = new ReportIndependAsset();
|
||||
independAsset.AssetPath = removeValue.AssetInfo.AssetPath;
|
||||
independAsset.AssetGUID = removeValue.AssetInfo.AssetGUID;
|
||||
independAsset.AssetType = removeValue.AssetInfo.AssetType.ToString();
|
||||
independAsset.FileSize = FileUtility.GetFileSize(removeValue.AssetInfo.AssetPath);
|
||||
context.IndependAssets.Add(independAsset);
|
||||
|
||||
allCollectAssets.Remove(removeValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user