mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-21 16:00:32 +00:00
Fixed an issue with task asyn loading waiting
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user