Bevy 0.16 upgrade (#24)

This commit is contained in:
extrawurst
2025-04-29 00:14:25 +02:00
committed by GitHub
parent b4bfa53df4
commit 11568d57ed
40 changed files with 932 additions and 699 deletions

View File

@@ -53,7 +53,7 @@ fn setup(mut commands: Commands, assets: Res<UIAssets>) {
}
fn spawn_head_ui(
parent: &mut ChildBuilder,
parent: &mut ChildSpawnerCommands,
bg: Handle<Image>,
regular: Handle<Image>,
damage: Handle<Image>,
@@ -129,7 +129,7 @@ fn update(
mut head_damage: Query<&mut Node, (With<HeadDamage>, Without<HeadImage>)>,
) {
if target.is_changed() {
if let Ok((mut vis, mut image)) = head_image.get_single_mut() {
if let Ok((mut vis, mut image)) = head_image.single_mut() {
if let Some(head) = target.head {
*vis = Visibility::Visible;
image.image = heads_images.heads[head.head].clone();
@@ -138,7 +138,7 @@ fn update(
}
}
if let Ok(mut node) = head_damage.get_single_mut() {
if let Ok(mut node) = head_damage.single_mut() {
node.height = Val::Percent(target.head.map(|head| head.damage()).unwrap_or(0.) * 100.);
}
}