Operation handles support error queries

操作句柄支持错误信息查询。
This commit is contained in:
hevinci
2022-04-24 18:30:35 +08:00
parent cbf142dbf8
commit 9bf22f2c79
19 changed files with 170 additions and 45 deletions

View File

@@ -34,6 +34,8 @@ namespace YooAsset
if (string.IsNullOrEmpty(guid))
{
Status = EStatus.Fail;
LastError = $"Not found asset : {AssetPath}";
YooLogger.Error(LastError);
InvokeCompletion();
return;
}
@@ -41,7 +43,7 @@ namespace YooAsset
{
Status = EStatus.Loading;
}
// 注意:模拟异步加载效果提前返回
if (IsWaitForAsyncComplete == false)
return;
@@ -59,7 +61,10 @@ namespace YooAsset
{
Status = AssetObject == null ? EStatus.Fail : EStatus.Success;
if (Status == EStatus.Fail)
YooLogger.Warning($"Failed to load asset object : {AssetPath}");
{
LastError = $"Failed to load asset object : {AssetPath}";
YooLogger.Error(LastError);
}
InvokeCompletion();
}
#endif