This commit is contained in:
何冠峰
2024-12-19 11:15:58 +08:00
parent dcaafedabb
commit d3c1c5acb0
20 changed files with 367 additions and 18 deletions

View File

@@ -149,7 +149,7 @@ namespace YooAsset.Editor
Dictionary<string, CollectAssetInfo> result = new Dictionary<string, CollectAssetInfo>(1000);
// 收集打包资源路径
List<string> findAssets =new List<string>();
List<string> findAssets = new List<string>();
if (AssetDatabase.IsValidFolder(CollectPath))
{
string collectDirectory = CollectPath;
@@ -218,13 +218,7 @@ namespace YooAsset.Editor
string bundleName = GetBundleName(command, group, assetInfo);
List<string> assetTags = GetAssetTags(group);
CollectAssetInfo collectAssetInfo = new CollectAssetInfo(CollectorType, bundleName, address, assetInfo, assetTags);
// 注意:模拟构建模式下不需要收集依赖资源
if (command.SimulateBuild)
collectAssetInfo.DependAssets = new List<AssetInfo>();
else
collectAssetInfo.DependAssets = GetAllDependencies(command, assetInfo.AssetPath);
collectAssetInfo.DependAssets = GetAllDependencies(command, assetInfo.AssetPath);
return collectAssetInfo;
}
@@ -272,7 +266,11 @@ namespace YooAsset.Editor
}
private List<AssetInfo> GetAllDependencies(CollectCommand command, string mainAssetPath)
{
string[] depends = AssetDatabase.GetDependencies(mainAssetPath, true);
// 注意:模拟构建模式下不需要收集依赖资源
if (command.SimulateBuild)
return new List<AssetInfo>();
string[] depends = command.AssetDependency.GetDependencies(mainAssetPath, true);
List<AssetInfo> result = new List<AssetInfo>(depends.Length);
foreach (string assetPath in depends)
{