//! This example illustrates how to react to component change. use bevy::{ecs::world::Ref, prelude::*}; use rand::Rng; fn main() { App::new() .add_plugins(DefaultPlugins) .add_startup_system(setup) .add_system(change_component) .add_system(change_detection) .add_system(tracker_monitoring) .run(); } #[derive(Component, PartialEq, Debug)] struct MyComponent(f32); fn setup(mut commands: Commands) { commands.spawn(MyComponent(0.)); commands.spawn(Transform::IDENTITY); } fn change_component(time: Res