use bevy::prelude::*; use bevy_inspector_egui::quick::{AssetInspectorPlugin, ResourceInspectorPlugin}; use bevy_lookup_curve::{editor::LookupCurveEditor, LookupCurve, LookupCurvePlugin}; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(LookupCurvePlugin) .add_plugins(AssetInspectorPlugin::::default()) .register_type::() .add_plugins(ResourceInspectorPlugin::::default()) .add_systems(Startup, setup) .add_systems(Update, move_sample) .run(); } #[derive(Resource, Default, Reflect)] struct LookupCurveDevState { curve_handle: Handle, curve_noasset: LookupCurve, sample_dir: f32, sample: f32, move_sample: bool, } fn setup(mut commands: Commands, assets: Res) { let handle = assets.load("example.curve.ron"); commands.spawn(LookupCurveEditor { sample: Some(0.0), ..LookupCurveEditor::with_save_path( handle.clone(), "./assets/example.curve.ron".to_string(), ) }); commands.insert_resource(LookupCurveDevState { curve_handle: handle, curve_noasset: LookupCurve::default().with_name("Not asset"), sample_dir: 1.0, sample: 0.0, move_sample: true, }); } fn move_sample( mut dev_state: ResMut, mut editor: Query<&mut LookupCurveEditor>, time: Res