mirror of https://github.com/tuyoogame/YooAsset
Fixed an issue with task asyn loading waiting
parent
c836dce54d
commit
6675e8f171
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue