Bevy 0.16 upgrade (#24)
This commit is contained in:
@@ -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.);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user