use bevy::prelude::*; use bevy_despawn_particles::prelude::*; #[derive(Component, Default)] pub struct Marker; pub struct MyTimer(pub Timer); #[derive(Resource)] pub struct MyPreset(pub DespawnParticlesPreset); impl Default for MyPreset { fn default() -> Self { Self( DespawnParticlesPreset::new() .with_linvel(100.0..180.0) .with_angvel(-5.0..5.0) .with_fade(true) .with_gray(true) .with_shrink(true), ) } } impl Default for MyTimer { fn default() -> Self { Self(Timer::from_seconds(0.5, TimerMode::Once)) } } fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(DespawnParticlesPlugin) .add_systems(Startup, setup) .add_systems(Update, tick) .init_resource::() .run(); } fn setup(mut commands: Commands, asset_server: Res) { commands.spawn(Camera2dBundle::default()); commands .spawn(SpriteBundle { texture: asset_server.load("asteroid_round.png"), ..default() }) .insert(Marker); } fn tick( mut timer: Local, time: Res