Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(bevy_state): fix broken links in init_state and insert_state #13929

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions crates/bevy_state/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,29 @@ pub trait AppExtStates {
///
/// This method is idempotent: it has no effect when called again using the same generic type.
///
/// Adds [`State<S>`] and [`NextState<S>`] resources, and enables use of the [`OnEnter`], [`OnTransition`] and [`OnExit`] schedules.
/// These schedules are triggered before [`Update`](crate::Update) and at startup.
/// Adds [`State<S>`] and [`NextState<S>`] resources, and enables use of the [`OnEnter`](crate::state::OnEnter),
/// [`OnTransition`](crate::state::OnTransition) and [`OnExit`](crate::state::OnExit) schedules.
/// These schedules are triggered before [`Update`](bevy_app::main_schedule::Update) and at startup.
///
/// If you would like to control how other systems run based on the current state, you can
/// emulate this behavior using the [`in_state`] [`Condition`].
/// emulate this behavior using the [`in_state`](crate::condition::in_state) [`Condition`](bevy_ecs::prelude::Condition).
///
/// Note that you can also apply state transitions at other points in the schedule
/// by triggering the [`StateTransition`](`bevy_ecs::schedule::StateTransition`) schedule manually.
/// by triggering the [`StateTransition`](struct@StateTransition) schedule manually.
fn init_state<S: FreelyMutableState + FromWorld>(&mut self) -> &mut Self;

/// Inserts a specific [`State`] to the current [`App`] and overrides any [`State`] previously
/// added of the same type.
///
/// Adds [`State<S>`] and [`NextState<S>`] resources, and enables use of the [`OnEnter`], [`OnTransition`] and [`OnExit`] schedules.
/// These schedules are triggered before [`Update`](crate::Update) and at startup.
/// Adds [`State<S>`] and [`NextState<S>`] resources, and enables use of the [`OnEnter`](crate::state::OnEnter),
/// [`OnTransition`](crate::state::OnTransition) and [`OnExit`](crate::state::OnExit) schedules.
/// These schedules are triggered before [`Update`](bevy_app::main_schedule::Update) and at startup.
///
/// If you would like to control how other systems run based on the current state, you can
/// emulate this behavior using the [`in_state`] [`Condition`].
/// emulate this behavior using the [`in_state`](crate::condition::in_state) [`Condition`](bevy_ecs::prelude::Condition).
///
/// Note that you can also apply state transitions at other points in the schedule
/// by triggering the [`StateTransition`](`bevy_ecs::schedule::StateTransition`) schedule manually.
/// by triggering the [`StateTransition`](struct@StateTransition) schedule manually.
fn insert_state<S: FreelyMutableState>(&mut self, state: S) -> &mut Self;

/// Sets up a type implementing [`ComputedStates`].
Expand Down