修复了资源文件不存在返回的handle无法完成的问题。
pull/28/head
hevinci 2022-07-20 10:57:40 +08:00
parent 2cb9278db0
commit 86142ed4db
3 changed files with 6 additions and 7 deletions

View File

@ -139,8 +139,8 @@ namespace YooAsset
{ {
if (assetInfo.IsInvalid) if (assetInfo.IsInvalid)
{ {
YooLogger.Warning(assetInfo.Error);
CompletedProvider completedProvider = new CompletedProvider(assetInfo); CompletedProvider completedProvider = new CompletedProvider(assetInfo);
completedProvider.SetCompleted();
return completedProvider.CreateHandle<SceneOperationHandle>(); return completedProvider.CreateHandle<SceneOperationHandle>();
} }
@ -178,8 +178,8 @@ namespace YooAsset
{ {
if (assetInfo.IsInvalid) if (assetInfo.IsInvalid)
{ {
YooLogger.Warning(assetInfo.Error);
CompletedProvider completedProvider = new CompletedProvider(assetInfo); CompletedProvider completedProvider = new CompletedProvider(assetInfo);
completedProvider.SetCompleted();
return completedProvider.CreateHandle<AssetOperationHandle>(); return completedProvider.CreateHandle<AssetOperationHandle>();
} }
@ -203,8 +203,8 @@ namespace YooAsset
{ {
if (assetInfo.IsInvalid) if (assetInfo.IsInvalid)
{ {
YooLogger.Warning(assetInfo.Error);
CompletedProvider completedProvider = new CompletedProvider(assetInfo); CompletedProvider completedProvider = new CompletedProvider(assetInfo);
completedProvider.SetCompleted();
return completedProvider.CreateHandle<SubAssetsOperationHandle>(); return completedProvider.CreateHandle<SubAssetsOperationHandle>();
} }

View File

@ -19,9 +19,9 @@ namespace YooAsset
} }
public override void Update() public override void Update()
{ {
if (IsDone) }
return; public void SetCompleted()
{
if (Status == EStatus.None) if (Status == EStatus.None)
{ {
Status = EStatus.Fail; Status = EStatus.Fail;

View File

@ -128,7 +128,6 @@ namespace YooAsset
/// <summary> /// <summary>
/// 创建操作句柄 /// 创建操作句柄
/// </summary> /// </summary>
/// <returns></returns>
public T CreateHandle<T>() where T : OperationHandleBase public T CreateHandle<T>() where T : OperationHandleBase
{ {
// 引用计数增加 // 引用计数增加