Skip to content

Commit

Permalink
Add note on StatesPlugin requirement for state code (bevyengine#14489)
Browse files Browse the repository at this point in the history
# Objective

Clarify that `StatesPlugin` is a prerequisite for state code.

Closes bevyengine#14329 .

Edit: am I missing a way to link `DefaultPlugins` correctly other than
using the URL? I guess I expected to be able to refer to it with
`bevy::prelude::DefaultPlugins` or some such :thinking:
  • Loading branch information
richchurcher authored Jul 29, 2024
1 parent a9f4fd8 commit 23cb0f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_state/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub trait AppExtStates {
///
/// Note that you can also apply state transitions at other points in the schedule
/// by triggering the [`StateTransition`](struct@StateTransition) schedule manually.
///
/// The use of any states requires the presence of [`StatesPlugin`] (which is included in `DefaultPlugins`).
fn init_state<S: FreelyMutableState + FromWorld>(&mut self) -> &mut Self;

/// Inserts a specific [`State`] to the current [`App`] and overrides any [`State`] previously
Expand Down

0 comments on commit 23cb0f9

Please sign in to comment.