pull/418/head
何冠峰 2024-12-12 18:13:33 +08:00
parent 038a52f7fc
commit 14ea408fec
2 changed files with 26 additions and 3 deletions

View File

@ -210,10 +210,24 @@ namespace YooAsset
return BundleDic3.ContainsKey(bundleGUID); return BundleDic3.ContainsKey(bundleGUID);
} }
/// <summary>
/// 获取所有的资源信息
/// </summary>
public AssetInfo[] GetAllAssetInfos()
{
List<AssetInfo> result = new List<AssetInfo>(AssetList.Count);
foreach (var packageAsset in AssetList)
{
AssetInfo assetInfo = new AssetInfo(PackageName, packageAsset, null);
result.Add(assetInfo);
}
return result.ToArray();
}
/// <summary> /// <summary>
/// 获取资源信息列表 /// 获取资源信息列表
/// </summary> /// </summary>
public AssetInfo[] GetAssetsInfoByTags(string[] tags) public AssetInfo[] GetAssetInfosByTags(string[] tags)
{ {
List<AssetInfo> result = new List<AssetInfo>(100); List<AssetInfo> result = new List<AssetInfo>(100);
foreach (var packageAsset in AssetList) foreach (var packageAsset in AssetList)

View File

@ -339,6 +339,15 @@ namespace YooAsset
return IsNeedDownloadFromRemoteInternal(assetInfo); return IsNeedDownloadFromRemoteInternal(assetInfo);
} }
/// <summary>
/// 获取所有的资源信息
/// </summary>
public AssetInfo[] GetAllAssetInfos()
{
DebugCheckInitialize();
return _playModeImpl.ActiveManifest.GetAllAssetInfos();
}
/// <summary> /// <summary>
/// 获取资源信息列表 /// 获取资源信息列表
/// </summary> /// </summary>
@ -347,7 +356,7 @@ namespace YooAsset
{ {
DebugCheckInitialize(); DebugCheckInitialize();
string[] tags = new string[] { tag }; string[] tags = new string[] { tag };
return _playModeImpl.ActiveManifest.GetAssetsInfoByTags(tags); return _playModeImpl.ActiveManifest.GetAssetInfosByTags(tags);
} }
/// <summary> /// <summary>
@ -357,7 +366,7 @@ namespace YooAsset
public AssetInfo[] GetAssetInfos(string[] tags) public AssetInfo[] GetAssetInfos(string[] tags)
{ {
DebugCheckInitialize(); DebugCheckInitialize();
return _playModeImpl.ActiveManifest.GetAssetsInfoByTags(tags); return _playModeImpl.ActiveManifest.GetAssetInfosByTags(tags);
} }
/// <summary> /// <summary>