Fix missing check that scene is loaded in animated_fox example.

This commit is contained in:
Robin KAY 2023-03-17 01:00:38 +00:00
parent 79285311f2
commit fc74926073

View File

@ -83,18 +83,20 @@ fn setup_scene_once_loaded(
if let (Ok(scene), Ok(mut player)) = if let (Ok(scene), Ok(mut player)) =
(scene_query.get_single(), player_query.get_single_mut()) (scene_query.get_single(), player_query.get_single_mut())
{ {
for entity in scene_manager.iter_instance_entities(**scene) { if scene_manager.instance_is_ready(**scene) {
commands.entity(entity).insert(OutlineBundle { for entity in scene_manager.iter_instance_entities(**scene) {
outline: OutlineVolume { commands.entity(entity).insert(OutlineBundle {
visible: true, outline: OutlineVolume {
width: 3.0, visible: true,
colour: Color::RED, width: 3.0,
}, colour: Color::RED,
..default() },
}); ..default()
});
}
player.play(animation.0.clone_weak()).repeat();
*done = true;
} }
player.play(animation.0.clone_weak()).repeat();
*done = true;
} }
} }
} }