use bevy::{log::info, prelude::*}; fn main() { App::new() .add_plugins(DefaultPlugins) .init_resource::() .add_startup_system(setup) .add_system(countdown) .add_system(print_when_completed) .run(); } #[derive(Component)] pub struct PrintOnCompletionTimer(Timer); pub struct Countdown { pub percent_trigger: Timer, pub main_timer: Timer, } impl Countdown { pub fn new() -> Self { Self { percent_trigger: Timer::from_seconds(4.0, true), main_timer: Timer::from_seconds(20.0, false), } } } impl Default for Countdown { fn default() -> Self { Self::new() } } fn setup(mut commands: Commands) { // Add an entity to the world with a timer commands .spawn() .insert(PrintOnCompletionTimer(Timer::from_seconds(5.0, false))); } /// This system ticks all the `Timer` components on entities within the scene /// using bevy's `Time` resource to get the delta between each update. fn print_when_completed(time: Res