From eb6b6e3aba8a5c79c5fa5eb67cc1bf6d94799db4 Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 13 Apr 2022 17:00:14 +0800 Subject: [PATCH] Fixed special case where the dependent bundle list contained the main bundle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了特殊情况下依赖的资源包列表里包含主资源包的问题 --- .../BuildTasks/TaskCreatePatchManifest.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs index a722b48..886b2f3 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs @@ -116,13 +116,13 @@ namespace YooAsset.Editor PatchAsset patchAsset = new PatchAsset(); patchAsset.AssetPath = assetInfo.AssetPath; patchAsset.BundleID = GetAssetBundleID(assetInfo.BundleName, patchManifest); - patchAsset.DependIDs = GetAssetBundleDependIDs(assetInfo, patchManifest); + patchAsset.DependIDs = GetAssetBundleDependIDs(patchAsset.BundleID, assetInfo, patchManifest); result.Add(patchAsset); } } return result; } - private int[] GetAssetBundleDependIDs(BuildAssetInfo assetInfo, PatchManifest patchManifest) + private int[] GetAssetBundleDependIDs(int mainBundleID, BuildAssetInfo assetInfo, PatchManifest patchManifest) { List result = new List(); foreach (var dependAssetInfo in assetInfo.AllDependAssetInfos) @@ -130,8 +130,11 @@ namespace YooAsset.Editor if (dependAssetInfo.BundleNameIsValid() == false) continue; int bundleID = GetAssetBundleID(dependAssetInfo.BundleName, patchManifest); - if (result.Contains(bundleID) == false) - result.Add(bundleID); + if (mainBundleID != bundleID) + { + if (result.Contains(bundleID) == false) + result.Add(bundleID); + } } return result.ToArray(); }