use bevy::prelude::*; pub struct BuildScenePlugin; impl Plugin for BuildScenePlugin { fn build(&self, app: &mut App) { app.add_startup_system(build_scene) // actual scene .add_system(print_positions); // debugging } } #[derive(Component)] struct Person; #[derive(Component)] pub struct Position { x: f32, y: f32 } pub fn build_scene(mut commands: Commands) { commands.spawn() .insert(Person) .insert(Position { x: 10.0, y: 10.0 } ); // camera // commands.spawn_bundle(OffAxisProjection { // transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y), // ..default() // }); } pub fn print_positions(query : Query<&Position>) { for _position in query.iter() { _ = 33; // println!("position {:?} {:?}", position.x, position.y) } }