Database Support
Refactored almost everything, but most importantly we now integrate with RethinkDB for game data.
This commit is contained in:
parent
5ffeb55214
commit
0b46d5ee39
839 changed files with 77349 additions and 112660 deletions
40
Assets/Plugins/AsyncAwaitUtil/Source/TaskExtensions.cs
Normal file
40
Assets/Plugins/AsyncAwaitUtil/Source/TaskExtensions.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
public static class TaskExtensions
|
||||
{
|
||||
public static IEnumerator AsIEnumerator(this Task task)
|
||||
{
|
||||
while (!task.IsCompleted)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
ExceptionDispatchInfo.Capture(task.Exception).Throw();
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerator<T> AsIEnumerator<T>(this Task<T> task)
|
||||
where T : class
|
||||
{
|
||||
while (!task.IsCompleted)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
ExceptionDispatchInfo.Capture(task.Exception).Throw();
|
||||
}
|
||||
|
||||
yield return task.Result;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue