use bevy::prelude::*; use bevy_egui::{EguiPlugin, EguiPrimaryContextPass}; use crate::particles::{LifetimeCurve, ParticleEffect, RandF32, RandUsize, RandVec2}; pub fn particle_editor_plugin(app: &mut App) { app.add_plugins(DefaultPlugins); app.add_plugins(EguiPlugin::default()); app.add_systems(EguiPrimaryContextPass, editor_ui); app.add_systems(Startup, setup_editor_effect); } fn setup_editor_effect(mut commands: Commands) { commands.spawn(( ParticleEffect { lifetime_seconds: RandF32 { value: 2.0, randomness: 0.1, }, batch_spawn_delay_seconds: RandF32 { value: 0.1, randomness: 0.05 }, particles_in_batch: RandUsize { value: 1, randomness: 1 }, initial_linear_velocity: RandVec2 { x: RandF32 { value: 0.0, randomness: 0.5 }, y: RandF32 { value: 10.0, randomness: 1.0 } }, initial_angular_velocity: RandF32 { value: 1.0, randomness: 0.5 }, scale: LifetimeCurve::new(&[ (0.0f32, 5.0), (2.0, 0.0) ]), color: LifetimeCurve::new(&[ (0.0f32, Srgba::new(1.0, 0.0, 0.0, 1.0).into()), (0.5, Srgba::new(0.0, 1.0, 0.0, 1.0).into()), (1.0, Srgba::new(0.0, 0.0, 1.0, 1.0).into()), (1.5, Srgba::new(1.0, 0.0, 1.0, 1.0).into()), (2.0, Srgba::new(1.0, 1.0, 1.0, 1.0).into()) ]), } )); } fn editor_ui() {}