diff --git a/src/main.rs b/src/main.rs index 0a3e78f..565cf02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,9 @@ fn main() { .run(); } +#[derive(Resource)] +struct GreetTimer(Timer); + #[derive(Component)] struct Name(String); @@ -27,9 +30,11 @@ fn update_people(mut query: Query<&mut Name, With>) { } } -fn greet_people(query: Query<&Name, With>) { - for name in &query { - println!("hello {}!", name.0); +fn greet_people(query: Query<&Name, With>, time:Res