根据NETAnalyzers调整代码
This commit is contained in:
何冠峰
2024-07-08 18:54:07 +08:00
parent e664f20d34
commit 21fbb01ce4
8 changed files with 16 additions and 18 deletions

View File

@@ -180,9 +180,9 @@ namespace YooAsset.Editor
for (int index = 0; index < manifest.BundleList.Count; index++)
{
var packageBundle = manifest.BundleList[index];
if (_cacheBundleTags.ContainsKey(index))
if (_cacheBundleTags.TryGetValue(index, out var value))
{
packageBundle.Tags = _cacheBundleTags[index].ToArray();
packageBundle.Tags = value.ToArray();
}
else
{

View File

@@ -56,9 +56,9 @@ namespace YooAsset.Editor
string bundleName = collectAssetInfo.BundleName;
foreach (var dependAsset in collectAssetInfo.DependAssets)
{
if (allBuildAssetInfos.ContainsKey(dependAsset.AssetPath))
if (allBuildAssetInfos.TryGetValue(dependAsset.AssetPath, out var value))
{
allBuildAssetInfos[dependAsset.AssetPath].AddReferenceBundleName(bundleName);
value.AddReferenceBundleName(bundleName);
}
else
{

View File

@@ -14,7 +14,7 @@ namespace YooAsset.Editor
protected override string[] GetBundleDepends(BuildContext context, string bundleName)
{
return new string[] { };
return Array.Empty<string>();
}
}
}