bevy/crates/bevy_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
..
src Add a way to toggle AudioSink (#6321) 2022-10-31 15:57:51 +00:00
Cargo.toml Update rodio requirement from 0.15 to 0.16 (#6020) 2022-09-19 13:56:56 +00:00