1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Module to handle inputs that are defined using the `leafwing_input_manager` crate
//!
//! ### Adding leafwing inputs
//!
//! You first need to create Inputs that are defined using the [`leafwing_input_manager`](https://github.com/Leafwing-Studios/leafwing-input-manager) crate.
//! (see the documentation of the crate for more information)
//! In particular your inputs should implement the [`Actionlike`](leafwing_input_manager::Actionlike) trait.
//!
//! ```rust
//! # use bevy_app::App;
//! # use bevy_reflect::Reflect;
//! # use serde::{Deserialize, Serialize};
//! use leafwing_input_manager::Actionlike;
//! use lightyear_inputs_leafwing::prelude::InputPlugin;
//!
//! #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Copy, Hash, Reflect, Actionlike)]
//! pub enum PlayerActions {
//! Up,
//! Down,
//! Left,
//! Right,
//! }
//!
//! let mut app = App::new();
//! app.add_plugins(InputPlugin::<PlayerActions>::default());
//! ```
//!
//! ### Usage
//!
//! The networking of inputs is completely handled for you. You just need to add the `InputPlugin` to your app.
//! Make sure that all your systems that depend on user inputs are added to the [`FixedUpdate`] [`Schedule`].
//!
//! Currently, global inputs (that are stored in a [`Resource`] instead of being attached to a specific [`Entity`] are not supported)
//!
//! [`FixedUpdate`]: bevy_app::prelude::FixedUpdate
//! [`Resource`]: bevy_ecs::prelude::Resource
//! [`Entity`]: bevy_ecs::prelude::Entity
//! [`Schedule`]: bevy_ecs::prelude::Schedule
extern crate alloc;
extern crate core;
extern crate std;
pub