Fixed an issue with task asyn loading waiting
parent
c836dce54d
commit
6675e8f171
|
@ -95,7 +95,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 异步操作任务
|
/// 异步操作任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public System.Threading.Tasks.Task<object> Task
|
public System.Threading.Tasks.Task Task
|
||||||
{
|
{
|
||||||
get { return _provider.Task; }
|
get { return _provider.Task; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,7 +199,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 异步操作任务
|
/// 异步操作任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Task<object> Task
|
public Task Task
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -207,7 +207,7 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
_taskCompletionSource = new TaskCompletionSource<object>();
|
_taskCompletionSource = new TaskCompletionSource<object>();
|
||||||
if (IsDone)
|
if (IsDone)
|
||||||
_taskCompletionSource.SetResult(this);
|
_taskCompletionSource.SetResult(null);
|
||||||
}
|
}
|
||||||
return _taskCompletionSource.Task;
|
return _taskCompletionSource.Task;
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_taskCompletionSource != null)
|
if(_taskCompletionSource != null)
|
||||||
_taskCompletionSource.TrySetResult(this);
|
_taskCompletionSource.TrySetResult(null);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue