Update patch manifest
更新资源清单:资源对象增加分类标签。
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
@@ -15,6 +16,11 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
public string AssetPath;
|
||||
|
||||
/// <summary>
|
||||
/// 资源的分类标签
|
||||
/// </summary>
|
||||
public string[] AssetTags;
|
||||
|
||||
/// <summary>
|
||||
/// 所属资源包ID
|
||||
/// </summary>
|
||||
@@ -24,5 +30,24 @@ namespace YooAsset
|
||||
/// 依赖的资源包ID列表
|
||||
/// </summary>
|
||||
public int[] DependIDs;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否包含Tag
|
||||
/// </summary>
|
||||
public bool HasTag(string[] tags)
|
||||
{
|
||||
if (tags == null || tags.Length == 0)
|
||||
return false;
|
||||
if (AssetTags == null || AssetTags.Length == 0)
|
||||
return false;
|
||||
|
||||
foreach (var tag in tags)
|
||||
{
|
||||
if (AssetTags.Contains(tag))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ namespace YooAsset
|
||||
public long SizeBytes;
|
||||
|
||||
/// <summary>
|
||||
/// Tags
|
||||
/// 资源包的分类标签
|
||||
/// </summary>
|
||||
public string[] Tags;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user