Add load all asset method.

增加新的资源加载方法:加载资源对象所属资源包里的所有资源。
This commit is contained in:
hevinci
2022-05-06 23:15:03 +08:00
parent 65875b66c2
commit afc08d4e46
18 changed files with 605 additions and 112 deletions

View File

@@ -173,7 +173,7 @@ namespace YooAsset
/// <summary>
/// 获取资源信息列表
/// </summary>
public static AssetInfo[] GetAssetsInfoByTag(PatchManifest patchManifest, string[] tags)
public static AssetInfo[] GetAssetsInfoByTags(PatchManifest patchManifest, string[] tags)
{
List<AssetInfo> result = new List<AssetInfo>(100);
foreach (var patchAsset in patchManifest.AssetList)
@@ -189,5 +189,20 @@ namespace YooAsset
}
return result.ToArray();
}
/// <summary>
/// 获取资源信息列表
/// </summary>
public static AssetInfo[] GetAssetsInfoByBundleName(PatchManifest patchManifest, string bundleName)
{
List<AssetInfo> result = new List<AssetInfo>(100);
foreach (var patchAsset in patchManifest.AssetList)
{
string tempName = patchManifest.GetBundleName(patchAsset.AssetPath);
if (tempName == bundleName)
result.Add(new AssetInfo(patchAsset.AssetPath));
}
return result.ToArray();
}
}
}