diff --git a/src/main.rs b/src/main.rs index 84b2ee1..e1fe3d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,9 @@ struct Person; #[derive(Component)] struct Name(String); +#[derive(Resource)] +struct GreetTimer(Timer); + fn add_people(mut commands: Commands) { commands.spawn((Person, Name("Lars Larson".to_string()))); commands.spawn((Person, Name("Cedric Fagbottom".to_string()))); @@ -18,9 +21,11 @@ fn gamarjoba() { println!("Gamarjoba, munde!"); } -fn greet_people(query: Query<&Name, With>) { - for name in &query { - println!("'sup {}", name.0); +fn greet_people(time: Res