Upgrade to Bevy 0.12.

This commit is contained in:
Nolan Darilek 2024-02-09 14:59:16 -06:00
parent e381109cad
commit 4e0a36c4a5
9 changed files with 17 additions and 17 deletions

View File

@ -13,24 +13,25 @@ speech_dispatcher_0_10 = ["bevy_tts/speech_dispatcher_0_10"]
speech_dispatcher_0_11 = ["bevy_tts/speech_dispatcher_0_11"]
[dependencies.bevy]
version = "0.11"
version = "0.12"
default-features = false
features = [
"bevy_gilrs",
"bevy_winit",
"x11",
"wayland",
"multi-threaded",
"serialize",
]
[dependencies]
bevy_rapier2d = "0.22"
bevy_synthizer = "0.4"
bevy_tts = { version = "0.6", default-features = false, features = ["tolk"] }
bevy_rapier2d = "0.24"
bevy_synthizer = "0.5"
bevy_tts = { version = "0.7", default-features = false, features = ["tolk"] }
coord_2d = "0.3"
futures-lite = "1"
here_be_dragons = { version = "0.3", features = ["serde"] }
leafwing-input-manager = "0.10"
leafwing-input-manager = "0.11"
maze_generator = "2"
once_cell = "1"
pathfinding = "4"

View File

@ -521,7 +521,6 @@ impl GlobalTransformExt for GlobalTransform {
other: &GlobalTransform,
other_collider: &Collider,
) -> ClosestPoints {
use bevy::math::Vec3Swizzles;
let scale = PHYSICS_SCALE.read().unwrap();
let pos1 = Isometry::new(
(self.translation() / *scale).xy().into(),
@ -540,7 +539,6 @@ impl GlobalTransformExt for GlobalTransform {
other: &GlobalTransform,
other_collider: &Collider,
) -> String {
use bevy::math::Vec3Swizzles;
let scale = PHYSICS_SCALE.read().unwrap();
let pos1 = Isometry::new(
(self.translation() / *scale).xy().into(),

View File

@ -421,7 +421,7 @@ where
if !config.states.is_empty() {
let states = config.states;
for state in states {
app.configure_set(Update, Exploration.run_if(in_state(state.clone())))
app.configure_sets(Update, Exploration.run_if(in_state(state.clone())))
.add_systems(OnExit(state), cleanup);
}
}

View File

@ -308,7 +308,7 @@ fn remove_direction(
mut removed: RemovedComponents<Transform>,
directions: Query<&CardinalDirection>,
) {
for entity in &mut removed {
for entity in removed.read() {
if directions.contains(entity) {
commands.entity(entity).remove::<CardinalDirection>();
}
@ -352,7 +352,7 @@ fn log_area_descriptions<State>(
if !config.log_area_descriptions {
return;
}
for event in events.iter() {
for event in events.read() {
let (entity1, entity2, started) = match event {
CollisionEvent::Started(collider1, collider2, _) => (collider1, collider2, true),
CollisionEvent::Stopped(collider1, collider2, _) => (collider1, collider2, false),

View File

@ -262,7 +262,7 @@ fn remove_destination(
entities: &Entities,
mut removed: RemovedComponents<Destination>,
) {
for entity in &mut removed {
for entity in removed.read() {
if entities.contains(entity) {
commands.entity(entity).remove::<Calculating>();
}
@ -326,6 +326,7 @@ fn negotiate_path(
direction,
collider,
rapier_context.integration_parameters.dt,
true,
QueryFilter::new()
.predicate(&|entity| obstructions.get(entity).is_ok())
.exclude_sensors()

View File

@ -139,7 +139,7 @@ fn exploration_focus_removed(
children: Query<&Children>,
) {
const ICON_GAIN: f64 = 3.;
for entity in &mut removed {
for entity in removed.read() {
if let Ok(mut icon) = query.get_mut(entity) {
icon.gain /= ICON_GAIN;
}

View File

@ -74,7 +74,7 @@ fn behind_removed(
mut sounds: Query<&mut Sound>,
) {
let downshift = 1. / config.downshift;
for entity in &mut removed {
for entity in removed.read() {
if let Ok(mut icon) = icons.get_mut(entity) {
icon.pitch *= downshift;
last_icon_pitch.remove(&entity);

View File

@ -44,7 +44,7 @@ fn removed(
mut removed: RemovedComponents<Volumetric>,
transforms: Query<Entity, (With<Transform>, With<GlobalTransform>)>,
) {
for entity in &mut removed {
for entity in removed.read() {
if transforms.get(entity).is_ok() {
commands.entity(entity).insert(TransformBundle::default());
}

View File

@ -267,7 +267,7 @@ fn viewshed_removed(
visible_entities: Query<&VisibleEntities>,
mut events: EventWriter<VisibilityChanged>,
) {
for entity in &mut query {
for entity in query.read() {
if let Ok(visible) = visible_entities.get(entity) {
for e in visible.iter() {
events.send(VisibilityChanged::Lost {
@ -344,7 +344,7 @@ fn remove_visible(
) {
if !removed.is_empty() {
let mut cache = HashMap::new();
for removed in &mut removed {
for removed in removed.read() {
for (viewer_entity, mut viewshed, mut visible_entities, start) in &mut viewers {
if !visible_entities.contains(&removed) {
continue;
@ -394,7 +394,7 @@ fn log_visible(
timer.tick(time.delta());
}
recently_lost.retain(|_entity, timer| !timer.finished());
for event in events.iter() {
for event in events.read() {
let viewer = match event {
VisibilityChanged::Gained { viewer, .. } => viewer,
VisibilityChanged::Lost { viewer, .. } => viewer,