From 84a336de2a148c70e6dafe8215378c4d40fedcdf Mon Sep 17 00:00:00 2001 From: luran Date: Sun, 29 Sep 2024 17:40:20 +0800 Subject: [PATCH] FIX: fix add depend bundle tags bug --- .../BaseTasks/TaskCreateManifest.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BaseTasks/TaskCreateManifest.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BaseTasks/TaskCreateManifest.cs index 4c8af55..3eca015 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BaseTasks/TaskCreateManifest.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BaseTasks/TaskCreateManifest.cs @@ -180,15 +180,18 @@ namespace YooAsset.Editor for (int index = 0; index < manifest.BundleList.Count; index++) { var packageBundle = manifest.BundleList[index]; - if (_cacheBundleTags.TryGetValue(index, out var value)) + foreach (var dependBundleID in packageBundle.DependIDs) { - packageBundle.Tags = value.ToArray(); - } - else - { - // 注意:SBP构建管线会自动剔除一些冗余资源的引用关系,导致游离资源包没有被任何主资源包引用。 - string warning = BuildLogger.GetErrorMessage(ErrorCode.FoundStrayBundle, $"Found stray bundle ! Bundle ID : {index} Bundle name : {packageBundle.BundleName}"); - BuildLogger.Warning(warning); + if (_cacheBundleTags.TryGetValue(dependBundleID, out var value)) + { + packageBundle.Tags = value.ToArray(); + } + else + { + // 注意:SBP构建管线会自动剔除一些冗余资源的引用关系,导致游离资源包没有被任何主资源包引用。 + string warning = BuildLogger.GetErrorMessage(ErrorCode.FoundStrayBundle, $"Found stray bundle ! Bundle ID : {index} Bundle name : {packageBundle.BundleName}"); + BuildLogger.Warning(warning); + } } } }