mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 22:09:53 -05:00
22 lines
417 B
C#
22 lines
417 B
C#
using System.Collections;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace UniGLTF
|
|
{
|
|
public static class TaskExtensions
|
|
{
|
|
public static IEnumerator AsIEnumerator(this Task task)
|
|
{
|
|
while (!task.IsCompleted)
|
|
{
|
|
yield return null;
|
|
}
|
|
|
|
if (task.IsFaulted)
|
|
{
|
|
throw task.Exception;
|
|
}
|
|
}
|
|
}
|
|
}
|