#![allow(clippy::type_complexity)] #![warn(missing_docs)] #![doc = include_str!("../README.md")] /// Common run conditions pub mod common_conditions; pub mod fixed_timestep; mod stopwatch; #[allow(clippy::module_inception)] mod time; mod timer; use fixed_timestep::FixedTime; pub use stopwatch::*; pub use time::*; pub use timer::*; use bevy_ecs::system::{Res, ResMut}; use bevy_utils::{tracing::warn, Duration, Instant}; use crossbeam_channel::{Receiver, Sender}; pub mod prelude { //! The Bevy Time Prelude. #[doc(hidden)] pub use crate::{fixed_timestep::FixedTime, Time, Timer, TimerMode}; } use bevy_app::{prelude::*, RunFixedUpdateLoop}; use bevy_ecs::prelude::*; use crate::fixed_timestep::run_fixed_update_schedule; /// Adds time functionality to Apps. #[derive(Default)] pub struct TimePlugin; #[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)] /// Updates the elapsed time. Any system that interacts with [Time] component should run after /// this. pub struct TimeSystem; impl Plugin for TimePlugin { fn build(&self, app: &mut App) { app.init_resource::