bevy/examples/audio
Lena Milizé 599ca782e3 Add a way to toggle AudioSink (#6321)
# 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.
2022-10-31 15:57:51 +00:00
..
audio.rs Doc/module style doc blocks for examples (#4438) 2022-05-16 13:53:20 +00:00
audio_control.rs Add a way to toggle AudioSink (#6321) 2022-10-31 15:57:51 +00:00