Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. var mouseCountStream = Observable.EveryUpdate()
  2. .Where(_ => Input.GetMouseButtonDown(0))// mousePress stream
  3. .Select(_ => 1)//each mousePress, we emit "1" value
  4. .Scan((previous, current) => previous + current)//counting
  5. .Subscribe(x => Debug.Log("Press count : " + x));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement