Skip to content

Instantly share code, notes, and snippets.

@divide-by-zero
Created July 19, 2015 14:39
Show Gist options
  • Save divide-by-zero/8c3da9c1ee1f46a2b3de to your computer and use it in GitHub Desktop.
Save divide-by-zero/8c3da9c1ee1f46a2b3de to your computer and use it in GitHub Desktop.
ObservableButtonDownTrigger を使う
var btnDownTrigger = button.gameObject.AddComponent<ObservableButtonDownTrigger>();
btnDownTrigger.OnButtonDown.DistinctUntilChanged().Throttle(TimeSpan.FromMilliseconds(1000)).Where(b => b).Subscribe(b => {
Debug.Log("1秒押された");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment