diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.cs index 26aa78a..8eb2087 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.cs @@ -115,8 +115,13 @@ namespace Cysharp.Threading.Tasks var status = this.source.GetStatus(this.token); if (status.IsCompletedSuccessfully()) { + this.source.GetResult(this.token); return CompletedTasks.AsyncUnit; } + else if(this.source is IUniTaskSource asyncUnitSource) + { + return new UniTask(asyncUnitSource, this.token); + } return new UniTask(new AsyncUnitSource(this.source), this.token); } @@ -422,6 +427,7 @@ namespace Cysharp.Threading.Tasks var status = this.source.GetStatus(this.token); if (status.IsCompletedSuccessfully()) { + this.source.GetResult(this.token); return UniTask.CompletedTask; }