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
32
Assets/Plugins/AsyncAwaitUtil/Source/AwaitExtensions.cs
Normal file
32
Assets/Plugins/AsyncAwaitUtil/Source/AwaitExtensions.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
public static class AwaitExtensions
|
||||
{
|
||||
public static TaskAwaiter<int> GetAwaiter(this Process process)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<int>();
|
||||
process.EnableRaisingEvents = true;
|
||||
|
||||
process.Exited += (s, e) => tcs.TrySetResult(process.ExitCode);
|
||||
|
||||
if (process.HasExited)
|
||||
{
|
||||
tcs.TrySetResult(process.ExitCode);
|
||||
}
|
||||
|
||||
return tcs.Task.GetAwaiter();
|
||||
}
|
||||
|
||||
// Any time you call an async method from sync code, you can either use this wrapper
|
||||
// method or you can define your own `async void` method that performs the await
|
||||
// on the given Task
|
||||
public static async void WrapErrors(this Task task)
|
||||
{
|
||||
await task;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue