Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompoundButton OnButtonClicked and OnButtonPressed firing twice #2341

Closed
Alexees opened this issue Jun 25, 2018 · 1 comment
Closed

CompoundButton OnButtonClicked and OnButtonPressed firing twice #2341

Alexees opened this issue Jun 25, 2018 · 1 comment

Comments

@Alexees
Copy link
Contributor

Alexees commented Jun 25, 2018

Overview

Debugging why functions hooked to OnButtonClicked or OnButtonPressed are called twice I found them actually being called twice internally for no particular reason.
The cause is that OnInputDown and OnInputClicked both call DoButtonPressed, which in turn always calls OnButtonPressed and OnButtonClicked.
Since OnInputReleased comes right in between Down and Clicked, a bool to avoid the second click to come in is not possible to use.
OnInputClicked should not call OnButtonPressed and OnInputDown should not call OnButtonClicked.
Maybe that's a relic from Hololens only times (not supporting Clicked or something like that), but with MotionControllers that's not working

Expected Behavior

Just called once each click

Actual Behavior

Called twice each click

Steps to reproduce

  • Apply Mixed Reality Scene Settings to a scene, add a holographic button to it and hook something up to one or both those events.
  • Play the scene and press the button

Unity Editor Version

2017.3.1p3

Mixed Reality Toolkit Release Version

june18_dev

@keveleigh
Copy link
Contributor

Duplicate of #1879, which I'm working on now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants