mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
Add access to pressed/just_pressed/just_released to Input<T> (#428)
Add access to pressed/just_pressed to Input<T>
This commit is contained in:
parent
cc3e99388a
commit
08dc1c1936
1 changed files with 12 additions and 0 deletions
|
@ -51,4 +51,16 @@ where
|
|||
self.just_pressed.clear();
|
||||
self.just_released.clear();
|
||||
}
|
||||
|
||||
pub fn get_pressed(&self) -> impl ExactSizeIterator<Item = &T> {
|
||||
self.pressed.iter()
|
||||
}
|
||||
|
||||
pub fn get_just_pressed(&self) -> impl ExactSizeIterator<Item = &T> {
|
||||
self.just_pressed.iter()
|
||||
}
|
||||
|
||||
pub fn get_just_released(&self) -> impl ExactSizeIterator<Item = &T> {
|
||||
self.just_released.iter()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue