mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-15 19:40:09 +00:00
DotNetCore Version
This commit is contained in:
32
src/UniTask.NetCoreSandbox/Program.cs
Normal file
32
src/UniTask.NetCoreSandbox/Program.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NetCoreSandbox
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Foo");
|
||||
var v = await DoAsync().AsTask();
|
||||
|
||||
Console.WriteLine("Bar:" + v);
|
||||
}
|
||||
|
||||
|
||||
static async UniTask<int> DoAsync()
|
||||
{
|
||||
var tcs = new UniTaskCompletionSource<int>();
|
||||
|
||||
tcs.TrySetResult(100);
|
||||
|
||||
|
||||
var v = await tcs.Task;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
13
src/UniTask.NetCoreSandbox/UniTask.NetCoreSandbox.csproj
Normal file
13
src/UniTask.NetCoreSandbox/UniTask.NetCoreSandbox.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>NetCoreSandbox</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\UniTask.NetCore\UniTask.NetCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user