From 0db4cf5fce3f239c2c08018d26cf0f496c24e7ce Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Mon, 29 Jul 2024 23:08:56 -0700 Subject: [PATCH] resources --- src/main.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index f47d66d..83e0556 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,9 +20,14 @@ fn add_people(mut commands: Commands) { commands.spawn((Person, Name("Zayna Nieves".to_string()))); } -fn greet_people(query: Query<&Name, With>) { - for name in &query { - println!("hello {}!", name.0); +#[derive(Resource)] +struct GreetTimer(Timer); + +fn greet_people(time: Res