Skip to content

Commit

Permalink
Update AssetBundleBuilder
Browse files Browse the repository at this point in the history
修改内置构建管线的构建结果验证逻辑。
  • Loading branch information
gmhevinci committed Jul 19, 2022
1 parent c782e81 commit 92fad7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static bool Run(List<IBuildTask> pipeline, BuildContext context)
try
{
var taskAttribute = task.GetType().GetCustomAttribute<TaskAttribute>();
Log($"---------------------------------------->{taskAttribute.Desc}");
Log($"---------------------------------------->{taskAttribute.Desc}<---------------------------------------");
task.Run(context);
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,14 @@ private void VerifyingBuildingResult(BuildContext context, AssetBundleManifest u
if (expectBuildinAssetPaths.Length != allBuildinAssetPaths.Length)
{
Debug.LogWarning($"构建的Bundle文件内的资源对象数量和预期不匹配 : {buildedBundle}");
isPass = false;
continue;
}

foreach (var buildinAssetPath in allBuildinAssetPaths)
{
var guid = AssetDatabase.AssetPathToGUID(buildinAssetPath);
if (string.IsNullOrEmpty(guid))
var intersectAssetList = expectBuildinAssetPaths.Except(allBuildinAssetPaths).ToList();
foreach (var intersectAssset in intersectAssetList)
{
Debug.LogWarning($"无效的资源路径,请检查路径是否带有特殊符号或中文:{buildinAssetPath}");
isPass = false;
continue;
}

bool isMatch = false;
foreach (var exceptBuildAssetPath in expectBuildinAssetPaths)
{
var guidExcept = AssetDatabase.AssetPathToGUID(exceptBuildAssetPath);
if (guid == guidExcept)
{
isMatch = true;
break;
}
}
if (isMatch == false)
{
Debug.LogWarning($"在构建的Bundle文件里发现了没有匹配的资源对象:{buildinAssetPath}");
isPass = false;
continue;
Debug.LogWarning($"构建失败的资源对象路径为 : {intersectAssset}");
}
isPass = false;
continue;
}

EditorTools.DisplayProgressBar("验证构建结果", ++progressValue, buildedBundles.Length);
}
EditorTools.ClearProgressBar();
Expand Down

0 comments on commit 92fad7f

Please sign in to comment.