Fixed special case where the dependent bundle list contained the main bundle

修复了特殊情况下依赖的资源包列表里包含主资源包的问题
pull/4/head
hevinci 2022-04-13 17:00:14 +08:00
parent 89bde69417
commit eb6b6e3aba
1 changed files with 7 additions and 4 deletions

View File

@ -116,13 +116,13 @@ namespace YooAsset.Editor
PatchAsset patchAsset = new PatchAsset();
patchAsset.AssetPath = assetInfo.AssetPath;
patchAsset.BundleID = GetAssetBundleID(assetInfo.BundleName, patchManifest);
patchAsset.DependIDs = GetAssetBundleDependIDs(assetInfo, patchManifest);
patchAsset.DependIDs = GetAssetBundleDependIDs(patchAsset.BundleID, assetInfo, patchManifest);
result.Add(patchAsset);
}
}
return result;
}
private int[] GetAssetBundleDependIDs(BuildAssetInfo assetInfo, PatchManifest patchManifest)
private int[] GetAssetBundleDependIDs(int mainBundleID, BuildAssetInfo assetInfo, PatchManifest patchManifest)
{
List<int> result = new List<int>();
foreach (var dependAssetInfo in assetInfo.AllDependAssetInfos)
@ -130,9 +130,12 @@ namespace YooAsset.Editor
if (dependAssetInfo.BundleNameIsValid() == false)
continue;
int bundleID = GetAssetBundleID(dependAssetInfo.BundleName, patchManifest);
if (mainBundleID != bundleID)
{
if (result.Contains(bundleID) == false)
result.Add(bundleID);
}
}
return result.ToArray();
}
private int GetAssetBundleID(string bundleName, PatchManifest patchManifest)