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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! Progress Tracking Helper Crate
//!
//! This crate helps you in cases where you need to track when a bunch of
//! work has been completed and perform a state transition.
//!
//! The most typical use case are loading screens, where you might need to
//! load assets, prepare the game world, etc… and then transition to the
//! in-game state when everything is done.
//!
//! To use this plugin, add one or more instances
//! [`ProgressPlugin<S>`] to your
//! `App`, configuring for the relevant states.
//!
//! ```rust
//! # use bevy::prelude::*;
//! # use iyes_progress::prelude::*;
//! #
//! # #[derive(States, Default, Debug, Clone, PartialEq, Eq, Hash)]
//! # enum MyStates {
//! # #[default]
//! # Loading,
//! # Done,
//! # }
//! #
//! # fn main_() {
//! App::new()
//! .add_plugins(DefaultPlugins)
//! .init_state::<MyStates>()
//! .add_plugins(
//! ProgressPlugin::<MyStates>::new()
//! .with_state_transition(MyStates::Loading, MyStates::Done),
//! )
//! // ...
//! .run();
//! # }
//! ```
//!
//! You can have any number of systems doing different things during
//! your loading state, and they can report their progress to this crate.
//!
//! This can be done in several different ways. Use whichever is convenient.
//!
//! - Using the special [`ProgressEntry`] system param
//! - By returning [`Progress`], [`HiddenProgress`], or a tuple of the two
//! - Add such systems to your app by calling `.track_progress::<S>()` or
//! `.track_progress_and_stop::<S>()` to add a run condition so they stop
//! running after they return full progress.
//! - Manually, by creating a [`ProgressEntryId`] and updating the values
//! stored in the [`ProgressTracker<S>`] resource.
/// All the public API offered by this crate
pub use crate*;