Skip to content

Commit 4acb25a

Browse files
improve doc
1 parent ca7b5f1 commit 4acb25a

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

crates/bevy_app/src/main_schedule.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ pub struct RunFixedUpdateLoop;
7474
#[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)]
7575
pub struct FixedUpdate;
7676

77-
/// Indicates that [`RunFixedUpdateLoop`] is currently active.
77+
/// Indicates that fixed updates are currently running.
78+
/// This is automatically set by `bevy_time`.
7879
#[derive(Resource)]
7980
pub struct FixedUpdateScheduleIsCurrentlyRunning {
8081
/// Sequentially increasing with each fixed update.

crates/bevy_gizmos/src/lib.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@
1515
//! ```
1616
//!
1717
//! See the documentation on [`Gizmos`](crate::gizmos::Gizmos) for more examples.
18+
//!
19+
//! Gizmos will only be visible for the upcomming frame, or until the next fixed
20+
//! update if drawn during [`FixedUpdate`] as indicated by [`FixedUpdateScheduleIsCurrentlyRunning`].
21+
//!
22+
//! [`FixedUpdate`]: ::bevy_app::FixedUpdate
23+
//! [`FixedUpdateScheduleIsCurrentlyRunning`]: ::bevy_app::FixedUpdateScheduleIsCurrentlyRunning
1824
1925
use std::mem;
2026

21-
use bevy_app::{Last, Plugin, Update};
27+
use bevy_app::{FixedUpdate, Last, Plugin, Update};
2228
use bevy_asset::{load_internal_asset, AddAsset, Assets, Handle, HandleUntyped};
2329
use bevy_core::cast_slice;
2430
use bevy_ecs::{
@@ -90,12 +96,10 @@ impl Plugin for GizmoPlugin {
9096
draw_aabbs,
9197
draw_all_aabbs.run_if(|config: Res<GizmoConfig>| config.aabb.draw_all),
9298
),
93-
);
94-
95-
// Ensure gizmos from previous fixed update are cleaned up if no other system
96-
// accesses gizmos during fixed update any more
97-
#[cfg(feature = "fixed_update")]
98-
app.add_systems(bevy_app::FixedUpdate, |_: Gizmos| ());
99+
)
100+
// Ensure gizmos from previous fixed update are cleaned up if no other system
101+
// accesses gizmos during fixed update any more
102+
.add_systems(FixedUpdate, |_: Gizmos| ());
99103

100104
let Ok(render_app) = app.get_sub_app_mut(RenderApp) else { return; };
101105

crates/bevy_internal/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ pub mod gizmos {
189189
//! ```
190190
//!
191191
//! See the documentation on [`Gizmos`](gizmos::Gizmos) for more examples.
192+
//!
193+
//! Gizmos will only be visible for the upcomming frame, or until the next fixed
194+
//! update if drawn during [`FixedUpdate`] as indicated by [`FixedUpdateScheduleIsCurrentlyRunning`].
195+
//!
196+
//! [`FixedUpdate`]: ::bevy_app::FixedUpdate
197+
//! [`FixedUpdateScheduleIsCurrentlyRunning`]: ::bevy_app::FixedUpdateScheduleIsCurrentlyRunning
192198
pub use bevy_gizmos::*;
193199
}
194200

0 commit comments

Comments
 (0)