From 92fad7f29bc3bb8a018cfa7b2dca11b2239e58d3 Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 19 Jul 2022 19:20:05 +0800 Subject: [PATCH] Update AssetBundleBuilder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改内置构建管线的构建结果验证逻辑。 --- .../BuildSystem/BuildRunner.cs | 2 +- .../BuildTasks/TaskVerifyBuildResult.cs | 34 +++---------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs index 0862b00..1d634e2 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs @@ -28,7 +28,7 @@ namespace YooAsset.Editor try { var taskAttribute = task.GetType().GetCustomAttribute(); - Log($"---------------------------------------->{taskAttribute.Desc}"); + Log($"---------------------------------------->{taskAttribute.Desc}<---------------------------------------"); task.Run(context); } catch (Exception e) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs index 4288b23..b5102d4 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs @@ -64,38 +64,14 @@ namespace YooAsset.Editor if (expectBuildinAssetPaths.Length != allBuildinAssetPaths.Length) { Debug.LogWarning($"构建的Bundle文件内的资源对象数量和预期不匹配 : {buildedBundle}"); + var intersectAssetList = expectBuildinAssetPaths.Except(allBuildinAssetPaths).ToList(); + foreach (var intersectAssset in intersectAssetList) + { + Debug.LogWarning($"构建失败的资源对象路径为 : {intersectAssset}"); + } isPass = false; continue; } - - foreach (var buildinAssetPath in allBuildinAssetPaths) - { - var guid = AssetDatabase.AssetPathToGUID(buildinAssetPath); - if (string.IsNullOrEmpty(guid)) - { - 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; - } - } - EditorTools.DisplayProgressBar("验证构建结果", ++progressValue, buildedBundles.Length); } EditorTools.ClearProgressBar();