1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using UnityEngine;
- namespace UniRx.Examples
- {
- public class Sample08_DetectDoubleClick : MonoBehaviour
- {
- void Start()
- {
-
-
-
-
-
-
-
-
- var clickStream = Observable.EveryUpdate()
- .Where(_ => Input.GetMouseButtonDown(0));
- clickStream.Buffer(clickStream.Throttle(TimeSpan.FromMilliseconds(250)))
- .Where(xs => xs.Count >= 2)
- .Subscribe(xs => Debug.Log("DoubleClick Detected! Count:" + xs.Count));
- }
- }
- }
|