Add note on StatesPlugin requirement for state code (#14489)

# Objective

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

Closes #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 🤔
This commit is contained in:
Rich Churcher 2024-07-30 11:41:14 +12:00 committed by GitHub
parent a9f4fd8ea1
commit 23cb0f9c54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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