Skip to content

Instantly share code, notes, and snippets.

@h-sao
Last active July 10, 2017 02:09
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 h-sao/5cb4f8aaed954646216b45a9029cdad6 to your computer and use it in GitHub Desktop.
Save h-sao/5cb4f8aaed954646216b45a9029cdad6 to your computer and use it in GitHub Desktop.
UniRx timer sample
var timerSubscription = OBservble.Timer(TimeSpan.FromSeconds(30a)
.Subscribe(_ => nextScene()));
OBservble.EverUpdate().Select(_=> Input.AnyKey).Where(x=>x == true)
.Subscribe(x =>
{
timerSubscription.Dispose();
timerSubscription = OBservble.Timer(TimeSpan.FromSeconds(30a)
.Subscribe(_ => nextScene()));
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment