use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, prelude::*, }; use rand::{rngs::StdRng, Rng, SeedableRng}; /// This example spawns a large number of cubes, each with its own changing position and material /// This is intended to be a stress test of bevy's ability to render many objects with different properties /// For the best results, run it in release mode: ```cargo run --example spawner --release /// NOTE: Bevy still has a number of optimizations to do in this area. Expect the performance here to go way up in the future fn main() { App::build() .add_plugins(DefaultPlugins) .add_plugin(FrameTimeDiagnosticsPlugin::default()) .add_plugin(LogDiagnosticsPlugin::default()) .add_startup_system(setup.system()) .add_system(move_cubes.system()) .run(); } fn move_cubes( time: Res