Update ShaderVariantCollector

pull/51/head
hevinci 2022-10-19 15:52:46 +08:00
parent 3aa46664f7
commit 2fb77c1bf8
1 changed files with 10 additions and 5 deletions

View File

@ -87,9 +87,14 @@ namespace YooAsset.Editor
List<string> allAssets = new List<string>(1000);
// 获取所有打包的资源
List<CollectAssetInfo> allCollectInfos = AssetBundleCollectorSettingData.Setting.GetAllPackageAssets(EBuildMode.DryRunBuild);
List<string> collectAssets = allCollectInfos.Select(t => t.AssetPath).ToList();
foreach (var assetPath in collectAssets)
List<CollectAssetInfo> allCollectAssetInfos = new List<CollectAssetInfo>();
List<CollectResult> collectResults = AssetBundleCollectorSettingData.Setting.GetAllPackageAssets(EBuildMode.DryRunBuild);
foreach (var collectResult in collectResults)
{
allCollectAssetInfos.AddRange(collectResult.CollectAssets);
}
List<string> 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();