Skip to content

Commit

Permalink
Try #3002:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Mar 7, 2022
2 parents cba9bcc + 8394e9b commit 1b2b41c
Show file tree
Hide file tree
Showing 19 changed files with 806 additions and 363 deletions.
16 changes: 9 additions & 7 deletions crates/bevy_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ pub use time::*;
pub mod prelude {
//! The Bevy Core Prelude.
#[doc(hidden)]
pub use crate::{DefaultTaskPoolOptions, Name, Time, Timer};
pub use crate::{
DefaultTaskPoolOptions, FixedTime, FixedTimestep, FixedTimestepState, Name, Time, Timer,
};
}

use bevy_app::prelude::*;
Expand All @@ -34,8 +36,7 @@ pub struct CorePlugin;
/// A `SystemLabel` enum for ordering systems relative to core Bevy systems.
#[derive(Debug, PartialEq, Eq, Clone, Hash, SystemLabel)]
pub enum CoreSystem {
/// Updates the elapsed time. Any system that interacts with [Time] component should run after
/// this.
/// Advances time. Any system that interacts with the [`Time`] resource should run after this.
Time,
}

Expand All @@ -49,18 +50,19 @@ impl Plugin for CorePlugin {
.create_default_pools(&mut app.world);

app.init_resource::<Time>()
.init_resource::<FixedTimesteps>()
.init_resource::<FixedTime>()
.init_resource::<FixedTimestepState>()
.register_type::<HashSet<String>>()
.register_type::<Option<String>>()
.register_type::<Entity>()
.register_type::<Name>()
.register_type::<Range<f32>>()
.register_type::<Timer>()
// time system is added as an "exclusive system" to ensure it runs before other systems
// in CoreStage::First
// Added as an "exclusive" system to ensure it runs before
// any other systems in CoreStage::First.
.add_system_to_stage(
CoreStage::First,
time_system.exclusive_system().label(CoreSystem::Time),
update_time.exclusive_system().label(CoreSystem::Time),
);

register_rust_types(app);
Expand Down
Loading

0 comments on commit 1b2b41c

Please sign in to comment.