WiP
This commit is contained in:
parent
c33335fc50
commit
b4965a3b05
5 changed files with 727 additions and 546 deletions
src
15
src/scene.rs
15
src/scene.rs
|
@ -4,21 +4,19 @@ pub struct BuildScenePlugin;
|
|||
|
||||
impl Plugin for BuildScenePlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app
|
||||
.add_startup_system(build_scene)
|
||||
.add_system(print_positions);
|
||||
app.add_startup_system(build_scene) // actual scene
|
||||
.add_system(print_positions); // debugging
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[derive(Component)]
|
||||
struct Person;
|
||||
|
||||
#[derive(Component)]
|
||||
struct Position { x: f32, y: f32 }
|
||||
pub struct Position { x: f32, y: f32 }
|
||||
|
||||
|
||||
fn build_scene(mut commands: Commands) {
|
||||
pub fn build_scene(mut commands: Commands) {
|
||||
commands.spawn()
|
||||
.insert(Person)
|
||||
.insert(Position { x: 10.0, y: 10.0 } );
|
||||
|
@ -30,9 +28,10 @@ fn build_scene(mut commands: Commands) {
|
|||
// });
|
||||
}
|
||||
|
||||
fn print_positions(query : Query<&Position>) {
|
||||
for position in query.iter() {
|
||||
pub fn print_positions(query : Query<&Position>) {
|
||||
for _position in query.iter() {
|
||||
|
||||
_ = 33;
|
||||
// println!("position {:?} {:?}", position.x, position.y)
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue