|
|
|
@ -80,7 +80,7 @@ fn init_trees(
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
})),
|
|
|
|
})),
|
|
|
|
Transform::from_xyz(-15.0, 0.0, 15.0).with_scale(Vec3::splat(10.0)),
|
|
|
|
Transform::from_xyz(-15.0, 0.0, 15.0).with_scale(Vec3::splat(10.0)),
|
|
|
|
));
|
|
|
|
)).observe(delete_tree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Spawn placeholder tree (green)
|
|
|
|
// Spawn placeholder tree (green)
|
|
|
|
@ -96,7 +96,7 @@ fn init_trees(
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
})),
|
|
|
|
})),
|
|
|
|
Transform::from_xyz(15.0, 0.0, 15.0).with_scale(Vec3::splat(10.0)),
|
|
|
|
Transform::from_xyz(15.0, 0.0, 15.0).with_scale(Vec3::splat(10.0)),
|
|
|
|
));
|
|
|
|
)).observe(delete_tree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Spawn placeholder tree (blue)
|
|
|
|
// Spawn placeholder tree (blue)
|
|
|
|
@ -112,7 +112,7 @@ fn init_trees(
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
})),
|
|
|
|
})),
|
|
|
|
Transform::from_xyz(0.0, 0.0, -15.0).with_scale(Vec3::splat(10.0)),
|
|
|
|
Transform::from_xyz(0.0, 0.0, -15.0).with_scale(Vec3::splat(10.0)),
|
|
|
|
));
|
|
|
|
)).observe(delete_tree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -509,9 +509,16 @@ fn scale_window(events: EventReader<WindowResized>, mut window: Single<&mut Wind
|
|
|
|
let n = a.min(b);
|
|
|
|
let n = a.min(b);
|
|
|
|
|
|
|
|
|
|
|
|
r.set_scale_factor(n);
|
|
|
|
r.set_scale_factor(n);
|
|
|
|
info!(
|
|
|
|
debug!(
|
|
|
|
"Proposed scale factor: ({} -> {a} / {} -> {b}) {n}",
|
|
|
|
"Proposed scale factor: ({} -> {a} / {} -> {b}) {n}",
|
|
|
|
r.width(),
|
|
|
|
r.width(),
|
|
|
|
r.height(),
|
|
|
|
r.height(),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn delete_tree(trigger: Trigger<Pointer<Click>>, mut commands: Commands) {
|
|
|
|
|
|
|
|
if matches!(trigger.event.button, PointerButton::Secondary) {
|
|
|
|
|
|
|
|
info!("Right Click -> Despawning {}", trigger.target());
|
|
|
|
|
|
|
|
commands.entity(trigger.target()).despawn();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|