update patch system

pull/82/head
hevinci 2023-03-08 12:48:57 +08:00
parent ed77d6dc1f
commit 8ff666d5e2
1 changed files with 33 additions and 19 deletions

View File

@ -6,6 +6,17 @@ namespace YooAsset
private readonly PatchAsset _patchAsset; private readonly PatchAsset _patchAsset;
private string _providerGUID; private string _providerGUID;
/// <summary>
/// 资源类型
/// </summary>
public System.Type AssetType { private set; get; }
/// <summary>
/// 错误信息
/// </summary>
public string Error { private set; get; }
/// <summary> /// <summary>
/// 唯一标识符 /// 唯一标识符
/// </summary> /// </summary>
@ -35,40 +46,45 @@ namespace YooAsset
} }
} }
/// <summary>
/// 错误信息
/// </summary>
internal string Error { private set; get; }
/// <summary> /// <summary>
/// 可寻址地址 /// 可寻址地址
/// </summary> /// </summary>
public string Address { private set; get; } public string Address
{
get
{
if (_patchAsset == null)
return string.Empty;
return _patchAsset.Address;
}
}
/// <summary> /// <summary>
/// 资源路径 /// 资源路径
/// </summary> /// </summary>
public string AssetPath { private set; get; } public string AssetPath
{
/// <summary> get
/// 资源类型 {
/// </summary> if (_patchAsset == null)
public System.Type AssetType { private set; get; } return string.Empty;
return _patchAsset.AssetPath;
}
}
// 注意:这是一个内部类,严格限制外部创建。
private AssetInfo() private AssetInfo()
{ {
// 注意:禁止从外部创建该类
} }
internal AssetInfo(PatchAsset patchAsset, System.Type assetType) internal AssetInfo(PatchAsset patchAsset, System.Type assetType)
{ {
if (patchAsset == null) if (patchAsset == null)
throw new System.Exception("Should never get here !"); throw new System.Exception("Should never get here !");
_providerGUID = string.Empty;
_patchAsset = patchAsset; _patchAsset = patchAsset;
AssetType = assetType; AssetType = assetType;
Address = patchAsset.Address;
AssetPath = patchAsset.AssetPath;
Error = string.Empty; Error = string.Empty;
} }
internal AssetInfo(PatchAsset patchAsset) internal AssetInfo(PatchAsset patchAsset)
@ -76,18 +92,16 @@ namespace YooAsset
if (patchAsset == null) if (patchAsset == null)
throw new System.Exception("Should never get here !"); throw new System.Exception("Should never get here !");
_providerGUID = string.Empty;
_patchAsset = patchAsset; _patchAsset = patchAsset;
AssetType = null; AssetType = null;
Address = patchAsset.Address;
AssetPath = patchAsset.AssetPath;
Error = string.Empty; Error = string.Empty;
} }
internal AssetInfo(string error) internal AssetInfo(string error)
{ {
_providerGUID = string.Empty;
_patchAsset = null; _patchAsset = null;
AssetType = null; AssetType = null;
Address = string.Empty;
AssetPath = string.Empty;
Error = error; Error = error;
} }
} }