首次提交

This commit is contained in:
Bob.Song
2026-03-05 18:07:55 +08:00
commit e125bb869e
4534 changed files with 563920 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
using System;
namespace NBC.Asset
{
public class AssetInfo
{
private readonly AssetData _assetData;
// public AssetData Data => _assetData;
/// <summary>
/// 资源路径
/// </summary>
public string Path { private set; get; }
/// <summary>
/// 资源类型
/// </summary>
public Type AssetType { private set; get; }
private string _providerGUID;
/// <summary>
/// 唯一标识符
/// </summary>
public string GUID
{
get
{
if (!string.IsNullOrEmpty(_providerGUID))
return _providerGUID;
_providerGUID = Util.GetAssetGUID(Path, AssetType);
return _providerGUID;
}
}
public AssetInfo(AssetData assetData, System.Type assetType)
{
if (assetData == null)
throw new Exception("assetData is null!");
_assetData = assetData;
AssetType = assetType;
Path = assetData.Path;
}
public AssetInfo(AssetData assetData)
{
if (assetData == null)
throw new System.Exception("assetData is null!");
_assetData = assetData;
AssetType = null;
Path = assetData.Path;
}
public bool HasTag(string[] tags)
{
return _assetData.HasTag(tags);
}
}
}