Replies: 2 comments 1 reply
-
Because |
Beta Was this translation helpful? Give feedback.
0 replies
-
No reason, it can take references: #14182 I think it's for historical reasons, where built in inputs are small and copy and clone, so taking references didn't change anything |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
https://docs.rs/bevy/0.14.0/bevy/input/struct.ButtonInput.html#method.pressed
Apparently only immutable reference are used in function body. When I define multiple shortcuts for an action, I need to create
Vec<KeyCode>
to store multiple KeyCode. But callany_pressed()
need force deep copy Vec, this will incur additional overhead."input" parameter's ownership is necessary?
Beta Was this translation helpful? Give feedback.
All reactions