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
@ -52,6 +52,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
|
|||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct InputPlugin;
|
pub struct InputPlugin;
|
||||||
|
|
||||||
|
/// Label for systems that update the input data.
|
||||||
#[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)]
|
#[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)]
|
||||||
pub struct InputSystem;
|
pub struct InputSystem;
|
||||||
|
|
||||||
@ -148,11 +149,14 @@ impl Plugin for InputPlugin {
|
|||||||
reflect(Serialize, Deserialize)
|
reflect(Serialize, Deserialize)
|
||||||
)]
|
)]
|
||||||
pub enum ButtonState {
|
pub enum ButtonState {
|
||||||
|
/// The button is pressed.
|
||||||
Pressed,
|
Pressed,
|
||||||
|
/// The button is not pressed.
|
||||||
Released,
|
Released,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ButtonState {
|
impl ButtonState {
|
||||||
|
/// Is this button pressed?
|
||||||
pub fn is_pressed(&self) -> bool {
|
pub fn is_pressed(&self) -> bool {
|
||||||
matches!(self, ButtonState::Pressed)
|
matches!(self, ButtonState::Pressed)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user