Skip to content

Instantly share code, notes, and snippets.

@neuecc
Created February 20, 2017 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neuecc/819c30bc297c5b698f5965df62d08fcd to your computer and use it in GitHub Desktop.
Save neuecc/819c30bc297c5b698f5965df62d08fcd to your computer and use it in GitHub Desktop.
public void Test()
{
Observable.ReturnUnit()
.SelectMany(_ => Observable.FromCoroutine(x => NestedCoroutine(x)))
.Subscribe(_ => Debug.Log("Very Good:)"));
}
IEnumerator NestedCoroutine(CancellationToken cancel)
{
yield return Observable.Timer(System.TimeSpan.FromSeconds(1))
.FirstOrDefault()
.ToYieldInstruction(cancel);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment