-
-
Notifications
You must be signed in to change notification settings - Fork 856
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
765 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.