Fixed an issue with task asyn loading waiting

pull/4/head
hevinci 2022-04-21 21:39:00 +08:00
parent c836dce54d
commit 6675e8f171
2 changed files with 4 additions and 4 deletions

View File

@ -95,7 +95,7 @@ namespace YooAsset
/// <summary>
/// 异步操作任务
/// </summary>
public System.Threading.Tasks.Task<object> Task
public System.Threading.Tasks.Task Task
{
get { return _provider.Task; }
}

View File

@ -199,7 +199,7 @@ namespace YooAsset
/// <summary>
/// 异步操作任务
/// </summary>
public Task<object> Task
public Task Task
{
get
{
@ -207,7 +207,7 @@ namespace YooAsset
{
_taskCompletionSource = new TaskCompletionSource<object>();
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
}