diff --git a/src/preparation_widget.rs b/src/preparation_widget.rs index a29a321..8103408 100644 --- a/src/preparation_widget.rs +++ b/src/preparation_widget.rs @@ -11,7 +11,8 @@ pub fn preparation_widget_plugin(app: &mut App) { .add_systems( Update, (animate_get_ready_widget).run_if(in_state(GameState::GetReady)), - ); + ) + .insert_resource(ReadySetGoTimer(Timer::from_seconds(3.0, TimerMode::Once))); } /// Marker component for things on the get-ready indicator @@ -19,7 +20,7 @@ pub fn preparation_widget_plugin(app: &mut App) { struct OnReadySetGo; /// Newtype wrapper for `Timer`. Used to count down during the "get ready" phase. -#[derive(Component)] +#[derive(Deref, DerefMut, Resource)] struct ReadySetGoTimer(Timer); /// Marker for the counter text segment @@ -71,6 +72,23 @@ fn despawn_get_ready(mut commands: Commands, to_despawn: Query>, + time: Res