mirror of
https://github.com/bevyengine/bevy
synced 2024-09-20 14:32:06 +00:00
Bevy Input Docs : lib.rs (#9468)
# Objective Complete the documentation of `bevy_input` (#3492). This PR is part of a triptych of PRs : - https://github.com/bevyengine/bevy/pull/9467 - https://github.com/bevyengine/bevy/pull/9469 ## Solution Add missing documentation on items in `lib.rs`. --------- Co-authored-by: Pascal Hertleif <killercup@gmail.com>
This commit is contained in:
parent
0087556028
commit
b9ab17e8b6
1 changed files with 4 additions and 0 deletions
|
@ -52,6 +52,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
|
|||
#[derive(Default)]
|
||||
pub struct InputPlugin;
|
||||
|
||||
/// Label for systems that update the input data.
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)]
|
||||
pub struct InputSystem;
|
||||
|
||||
|
@ -148,11 +149,14 @@ impl Plugin for InputPlugin {
|
|||
reflect(Serialize, Deserialize)
|
||||
)]
|
||||
pub enum ButtonState {
|
||||
/// The button is pressed.
|
||||
Pressed,
|
||||
/// The button is not pressed.
|
||||
Released,
|
||||
}
|
||||
|
||||
impl ButtonState {
|
||||
/// Is this button pressed?
|
||||
pub fn is_pressed(&self) -> bool {
|
||||
matches!(self, ButtonState::Pressed)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue