diff --git a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs index 9c5aa13..aa83772 100644 --- a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs +++ b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs @@ -52,7 +52,7 @@ namespace YooAsset.Editor throw new System.Exception("Shader variant file extension is invalid."); // 注意:先删除再保存,否则ShaderVariantCollection内容将无法及时刷新 - AssetDatabase.DeleteAsset(ShaderVariantCollectorSettingData.Setting.SavePath); + AssetDatabase.DeleteAsset(ShaderVariantCollectorSettingData.Setting.SavePath); EditorTools.CreateFileDirectory(saveFilePath); _saveFilePath = saveFilePath; _completedCallback = completedCallback; @@ -87,9 +87,14 @@ namespace YooAsset.Editor List allAssets = new List(1000); // 获取所有打包的资源 - List allCollectInfos = AssetBundleCollectorSettingData.Setting.GetAllPackageAssets(EBuildMode.DryRunBuild); - List collectAssets = allCollectInfos.Select(t => t.AssetPath).ToList(); - foreach (var assetPath in collectAssets) + List allCollectAssetInfos = new List(); + List collectResults = AssetBundleCollectorSettingData.Setting.GetAllPackageAssets(EBuildMode.DryRunBuild); + foreach (var collectResult in collectResults) + { + allCollectAssetInfos.AddRange(collectResult.CollectAssets); + } + List allAssetPath = allCollectAssetInfos.Select(t => t.AssetPath).ToList(); + foreach (var assetPath in allAssetPath) { string[] depends = AssetDatabase.GetDependencies(assetPath, true); foreach (var depend in depends) @@ -97,7 +102,7 @@ namespace YooAsset.Editor if (allAssets.Contains(depend) == false) allAssets.Add(depend); } - EditorTools.DisplayProgressBar("获取所有打包资源", ++progressValue, collectAssets.Count); + EditorTools.DisplayProgressBar("获取所有打包资源", ++progressValue, allAssetPath.Count); } EditorTools.ClearProgressBar();