Update patch manifest

更新资源清单:资源对象增加分类标签。
This commit is contained in:
hevinci
2022-05-11 16:23:31 +08:00
parent ae465a47a9
commit 67eeae31c7
9 changed files with 77 additions and 17 deletions

View File

@@ -10,7 +10,8 @@ namespace YooAsset.Editor
private string _mainBundleName;
private string _shareBundleName;
private readonly HashSet<string> _referenceBundleNames = new HashSet<string>();
private bool _isAddAssetTags = false;
/// <summary>
/// 收集器类型
/// </summary>
@@ -37,10 +38,15 @@ namespace YooAsset.Editor
public bool IsShaderAsset { private set; get; }
/// <summary>
/// 资源分类标签列表
/// 资源分类标签
/// </summary>
public readonly List<string> AssetTags = new List<string>();
/// <summary>
/// 资源包的分类标签
/// </summary>
public readonly List<string> BundleTags = new List<string>();
/// <summary>
/// 依赖的所有资源
/// 注意:包括零依赖资源和冗余资源(资源包名无效)
@@ -89,10 +95,15 @@ namespace YooAsset.Editor
}
/// <summary>
/// 添加资源分类标签
/// 添加资源分类标签
/// 说明:原始定义的资源分类标签
/// </summary>
public void AddAssetTags(List<string> tags)
{
if (_isAddAssetTags)
throw new Exception("Should never get here !");
_isAddAssetTags = true;
foreach (var tag in tags)
{
if (AssetTags.Contains(tag) == false)
@@ -101,6 +112,21 @@ namespace YooAsset.Editor
}
}
}
/// <summary>
/// 添加资源包的分类标签
/// 说明:传染算法统计到的分类标签
/// </summary>
public void AddBundleTags(List<string> tags)
{
foreach (var tag in tags)
{
if (BundleTags.Contains(tag) == false)
{
BundleTags.Add(tag);
}
}
}
/// <summary>
/// 资源包名是否存在