use bevy::prelude::*; #[derive(Component)] struct Person; #[derive(Component)] struct Name(String); #[derive(Resource)] struct GreetTimer(Timer); #[derive(Resource)] struct UpdateTimer(Timer); pub struct HelloPlugin; impl Plugin for HelloPlugin { fn build(&self, app: &mut App) { app.insert_resource(GreetTimer(Timer::from_seconds(2.0, TimerMode::Repeating))); app.insert_resource(UpdateTimer(Timer::from_seconds(10.0, TimerMode::Once))); app.add_systems(Startup, add_people); app.add_systems(Update, (update_people, greet_people).chain()); } } fn add_people(mut commands: Commands) { commands.spawn((Person, Name("Alkesey Mirnekov".to_string()))); commands.spawn((Person, Name("Alkesey Mirnekov 2".to_string()))); commands.spawn((Person, Name("Alkesey Mirnekov 3".to_string()))); } fn greet_people(time: Res