docs: update docs and comments that still refer to stages (#8156)
Documentation should no longer be using pre-stageless terminology to avoid confusion. - update all docs referring to stages to instead refer to sets/schedules where appropriate - also mention `apply_system_buffers` for anything system-buffer-related that previously referred to buffers being applied "at the end of a stage"
This commit is contained in:
parent
56303be5f0
commit
19e5c6831c
@ -11,7 +11,7 @@ fn main() {
|
|||||||
// Add the counter resource
|
// Add the counter resource
|
||||||
world.insert_resource(Counter { value: 0 });
|
world.insert_resource(Counter { value: 0 });
|
||||||
|
|
||||||
// Create a schedule and a stage
|
// Create a schedule
|
||||||
let mut schedule = Schedule::default();
|
let mut schedule = Schedule::default();
|
||||||
|
|
||||||
// Add systems to increase the counter and to print out the current value
|
// Add systems to increase the counter and to print out the current value
|
||||||
|
@ -283,8 +283,8 @@ impl<'a, 'w, 's, E: Event> IntoIterator for &'a mut EventReader<'w, 's, E> {
|
|||||||
/// // which allows one to do all kinds of clever things with type erasure, such as sending
|
/// // which allows one to do all kinds of clever things with type erasure, such as sending
|
||||||
/// // custom events to unknown 3rd party plugins (modding API).
|
/// // custom events to unknown 3rd party plugins (modding API).
|
||||||
/// //
|
/// //
|
||||||
/// // NOTE: the event won't actually be sent until commands get flushed
|
/// // NOTE: the event won't actually be sent until commands get applied during
|
||||||
/// // at the end of the current stage.
|
/// // apply_system_buffers.
|
||||||
/// commands.add(|w: &mut World| {
|
/// commands.add(|w: &mut World| {
|
||||||
/// w.send_event(MyEvent);
|
/// w.send_event(MyEvent);
|
||||||
/// });
|
/// });
|
||||||
|
@ -769,7 +769,8 @@ pub trait SystemBuffer: FromWorld + Send + 'static {
|
|||||||
fn apply(&mut self, system_meta: &SystemMeta, world: &mut World);
|
fn apply(&mut self, system_meta: &SystemMeta, world: &mut World);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A [`SystemParam`] that stores a buffer which gets applied to the [`World`] at the end of a stage.
|
/// A [`SystemParam`] that stores a buffer which gets applied to the [`World`] during
|
||||||
|
/// [`apply_system_buffers`](crate::schedule::apply_system_buffers).
|
||||||
/// This is used internally by [`Commands`] to defer `World` mutations.
|
/// This is used internally by [`Commands`] to defer `World` mutations.
|
||||||
///
|
///
|
||||||
/// [`Commands`]: crate::system::Commands
|
/// [`Commands`]: crate::system::Commands
|
||||||
@ -812,7 +813,7 @@ pub trait SystemBuffer: FromWorld + Send + 'static {
|
|||||||
/// struct AlarmFlag(bool);
|
/// struct AlarmFlag(bool);
|
||||||
///
|
///
|
||||||
/// impl AlarmFlag {
|
/// impl AlarmFlag {
|
||||||
/// /// Sounds the alarm at the end of the current stage.
|
/// /// Sounds the alarm the next time buffers are applied via apply_system_buffers.
|
||||||
/// pub fn flag(&mut self) {
|
/// pub fn flag(&mut self) {
|
||||||
/// self.0 = true;
|
/// self.0 = true;
|
||||||
/// }
|
/// }
|
||||||
@ -820,7 +821,7 @@ pub trait SystemBuffer: FromWorld + Send + 'static {
|
|||||||
///
|
///
|
||||||
/// impl SystemBuffer for AlarmFlag {
|
/// impl SystemBuffer for AlarmFlag {
|
||||||
/// // When `AlarmFlag` is used in a system, this function will get
|
/// // When `AlarmFlag` is used in a system, this function will get
|
||||||
/// // called at the end of the system's stage.
|
/// // called the next time buffers are applied via apply_system_buffers.
|
||||||
/// fn apply(&mut self, system_meta: &SystemMeta, world: &mut World) {
|
/// fn apply(&mut self, system_meta: &SystemMeta, world: &mut World) {
|
||||||
/// if self.0 {
|
/// if self.0 {
|
||||||
/// world.resource_mut::<Alarm>().0 = true;
|
/// world.resource_mut::<Alarm>().0 = true;
|
||||||
|
@ -73,7 +73,8 @@ pub trait BuildChildrenTransformExt {
|
|||||||
/// [`Transform`].
|
/// [`Transform`].
|
||||||
///
|
///
|
||||||
/// Note that both the hierarchy and transform updates will only execute
|
/// Note that both the hierarchy and transform updates will only execute
|
||||||
/// at the end of the current stage.
|
/// the next time commands are applied
|
||||||
|
/// (during [`apply_system_buffers`](bevy_ecs::schedule::apply_system_buffers)).
|
||||||
fn set_parent_in_place(&mut self, parent: Entity) -> &mut Self;
|
fn set_parent_in_place(&mut self, parent: Entity) -> &mut Self;
|
||||||
|
|
||||||
/// Make this entity parentless while preserving this entity's [`GlobalTransform`]
|
/// Make this entity parentless while preserving this entity's [`GlobalTransform`]
|
||||||
@ -83,7 +84,8 @@ pub trait BuildChildrenTransformExt {
|
|||||||
/// [`Transform`].
|
/// [`Transform`].
|
||||||
///
|
///
|
||||||
/// Note that both the hierarchy and transform updates will only execute
|
/// Note that both the hierarchy and transform updates will only execute
|
||||||
/// at the end of the current stage.
|
/// the next time commands are applied
|
||||||
|
/// (during [`apply_system_buffers`](bevy_ecs::schedule::apply_system_buffers)).
|
||||||
fn remove_parent_in_place(&mut self) -> &mut Self;
|
fn remove_parent_in_place(&mut self) -> &mut Self;
|
||||||
}
|
}
|
||||||
impl<'w, 's, 'a> BuildChildrenTransformExt for EntityCommands<'w, 's, 'a> {
|
impl<'w, 's, 'a> BuildChildrenTransformExt for EntityCommands<'w, 's, 'a> {
|
||||||
|
@ -144,7 +144,7 @@ impl Plugin for WinitPlugin {
|
|||||||
) = create_window_system_state.get_mut(&mut app.world);
|
) = create_window_system_state.get_mut(&mut app.world);
|
||||||
|
|
||||||
// Here we need to create a winit-window and give it a WindowHandle which the renderer can use.
|
// Here we need to create a winit-window and give it a WindowHandle which the renderer can use.
|
||||||
// It needs to be spawned before the start of the startup-stage, so we cannot use a regular system.
|
// It needs to be spawned before the start of the startup schedule, so we cannot use a regular system.
|
||||||
// Instead we need to create the window and spawn it using direct world access
|
// Instead we need to create the window and spawn it using direct world access
|
||||||
create_window(
|
create_window(
|
||||||
commands,
|
commands,
|
||||||
|
Loading…
Reference in New Issue
Block a user