We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4aca402 commit 9d122a7Copy full SHA for 9d122a7
examples/mobile/src/lib.rs
@@ -37,7 +37,16 @@ fn main() {
37
// This can help reduce cpu usage on mobile devices
38
.insert_resource(WinitSettings::mobile())
39
.add_systems(Startup, (setup_scene, setup_music))
40
- .add_systems(Update, (touch_camera, button_handler, handle_lifetime))
+ .add_systems(
41
+ Update,
42
+ (
43
+ touch_camera,
44
+ button_handler,
45
+ // Only run the lifetime handler when an [`AudioSink`] component exists in the world.
46
+ // This ensures we don't try to manage audio that hasn't been initialized yet.
47
+ handle_lifetime.run_if(any_with_component::<AudioSink>),
48
+ ),
49
+ )
50
.run();
51
}
52
0 commit comments