mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 05:03:47 +00:00
599ca782e3
# Objective Currently toggling an `AudioSink` (for example from a game menu) requires writing ```rs if sink.is_paused() { sink.play(); } else { sink.pause(); } ``` It would be nicer if we could reduce this down to a single line ```rs sink.toggle(); ``` ## Solution Add an `AudioSink::toggle` method which does exactly that. --- ## Changelog - Added `AudioSink::toggle` which can be used to toggle state of a sink. |
||
---|---|---|
.. | ||
audio.rs | ||
audio_control.rs |