From 6675e8f17170337c28c8ed7deeee19c456a45132 Mon Sep 17 00:00:00 2001 From: hevinci Date: Thu, 21 Apr 2022 21:39:00 +0800 Subject: [PATCH] Fixed an issue with task asyn loading waiting --- .../Runtime/AssetSystem/Handles/OperationHandleBase.cs | 2 +- .../YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/YooAsset/Runtime/AssetSystem/Handles/OperationHandleBase.cs b/Assets/YooAsset/Runtime/AssetSystem/Handles/OperationHandleBase.cs index 6e8ab0f..38f01ae 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Handles/OperationHandleBase.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Handles/OperationHandleBase.cs @@ -95,7 +95,7 @@ namespace YooAsset /// /// 异步操作任务 /// - public System.Threading.Tasks.Task Task + public System.Threading.Tasks.Task Task { get { return _provider.Task; } } diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs index a37ad96..71d7604 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs @@ -199,7 +199,7 @@ namespace YooAsset /// /// 异步操作任务 /// - public Task Task + public Task Task { get { @@ -207,7 +207,7 @@ namespace YooAsset { _taskCompletionSource = new TaskCompletionSource(); if (IsDone) - _taskCompletionSource.SetResult(this); + _taskCompletionSource.SetResult(null); } return _taskCompletionSource.Task; } @@ -228,7 +228,7 @@ namespace YooAsset } if(_taskCompletionSource != null) - _taskCompletionSource.TrySetResult(this); + _taskCompletionSource.TrySetResult(null); } #endregion }