bevy/examples/games
Joona Aalto ed151e756c
Migrate audio to required components (#15573)
# Objective

What's that? Another PR for the grand migration to required components?
This time, audio!

## Solution

Deprecate `AudioSourceBundle`, `AudioBundle`, and `PitchBundle`, as per
the [chosen
proposal](https://hackmd.io/@bevy/required_components/%2Fzxgp-zMMRUCdT7LY1ZDQwQ).

However, we cannot call the component `AudioSource`, because that's what
the stored asset is called. I deliberated on a few names, like
`AudioHandle`, or even just `Audio`, but landed on `AudioPlayer`, since
it's probably the most accurate and "nice" name for this. Open to
alternatives though.

---

## Migration Guide

Replace all insertions of `AudioSoucreBundle`, `AudioBundle`, and
`PitchBundle` with the `AudioPlayer` component. The other components
required by it will now be inserted automatically.

In cases where the generics cannot be inferred, you may need to specify
them explicitly. For example:

```rust
commands.spawn(AudioPlayer::<AudioSource>(asset_server.load("sounds/sick_beats.ogg")));
```
2024-10-01 22:43:29 +00:00
..
alien_cake_addict.rs Migrate scenes to required components (#15579) 2024-10-01 22:42:11 +00:00
breakout.rs Migrate audio to required components (#15573) 2024-10-01 22:43:29 +00:00
contributors.rs Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
desk_toy.rs Migrate meshes and materials to required components (#15524) 2024-10-01 21:33:17 +00:00
game_menu.rs Fixing text sizes for examples (#15190) 2024-09-16 23:14:37 +00:00
loading_screen.rs Migrate scenes to required components (#15579) 2024-10-01 22:42:11 +00:00
stepping.rs Fixing text sizes for examples (#15190) 2024-09-16 23:14:37 +00:00