Support enabling/disabling mouse/keyboard movement #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to be able to enable/disable the FlyCamera movement systems so that I could use this crate for controlling the camera, and still be able to interact with UI elements.
I intend to use this with
mouse_button_activate = Some(MouseButton::Right)
andactivate_is_toggle = false
to work similarly to some other game engines I've used but I thought I'd make it a bit more flexible while I was at it. 😄I've made it so that you can specify a mouse button or key to 'activate' motion, and then if
activate_is_toggle
is set, then pressing the button/key will toggle whether movement is activated, else if it is not set, you have to hold down the button/key for movement to be activated.I also made the default be
activate_is_toggle = true
and no 'bindings' set, and the 'activate' state istrue
so that the default behaviour before this PR is preserved where movement is always on.NOTE: This is based on PR #2 .