Skip to content

Commit

Permalink
ok all
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed May 30, 2019
1 parent fbe6746 commit 642cbe6
Show file tree
Hide file tree
Showing 31 changed files with 765 additions and 66 deletions.
33 changes: 23 additions & 10 deletions Assets/Scenes/SandboxMain.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UniRx.Async;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;

public class SandboxMain : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
RunAsync().Forget();
}
public Button okButton;
public Button cancelButton;
CancellationTokenSource cts;

async UniTaskVoid RunAsync()
async void Start()
{
var id = await UniTask.Run(() => System.Threading.Thread.CurrentThread.ManagedThreadId, configureAwait: false);
UnityEngine.Debug.Log("ReturnId:" + id);
UnityEngine.Debug.Log("CurrentId:" + System.Threading.Thread.CurrentThread.ManagedThreadId);
await UniTask.CompletedTask; // ok

// var subject = new Subject<Unit>();
//subject.OnCompleted();
IObservable<AsyncUnit> subject = default;
try
{
await subject.ToUniTask(); // exception
}
catch (Exception exception)
{
Debug.Log(exception);
}
}
}

Loading

0 comments on commit 642cbe6

Please sign in to comment.