use bevy::prelude::*; use bevy_despawn_particles::prelude::*; use bevy_variable_property::prelude::*; #[derive(Component, Default)] pub struct Marker; pub struct MyTimer(pub Timer); pub struct RandomSize(pub Property); pub struct RandomScale(pub Property); impl Default for RandomSize { fn default() -> Self { Self((Vec2::splat(96.)..Vec2::splat(512.)).into()) } } impl Default for RandomScale { fn default() -> Self { Self((Vec3::splat(0.3)..Vec3::splat(3.0)).into()) } } 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) .run(); } fn setup(mut commands: Commands, asset_server: Res) { commands.spawn(Camera2dBundle::default()); spawn( commands, asset_server, RandomSize::default().0.get_value(), RandomScale::default().0.get_value(), ); } fn tick( mut timer: Local, time: Res