bevy/examples/mobile
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
..
android_basic Add features to switch NativeActivity and GameActivity usage (#12095) 2024-10-01 22:23:48 +00:00
android_example Add features to switch NativeActivity and GameActivity usage (#12095) 2024-10-01 22:23:48 +00:00
android_example_native Add features to switch NativeActivity and GameActivity usage (#12095) 2024-10-01 22:23:48 +00:00
bevy_mobile_example.xcodeproj daily job running mobile example on real devices (#8216) 2023-03-28 23:16:07 +00:00
ios-src IOS, Android... same thing (#7493) 2023-02-06 18:08:49 +00:00
src Migrate audio to required components (#15573) 2024-10-01 22:43:29 +00:00
.gitignore Add features to switch NativeActivity and GameActivity usage (#12095) 2024-10-01 22:23:48 +00:00
build_rust_deps.sh Fix alignment on ios simulator (#10178) 2023-10-21 22:19:46 +00:00
Cargo.toml Add features to switch NativeActivity and GameActivity usage (#12095) 2024-10-01 22:23:48 +00:00
Makefile Improve selection of iOS device in mobile example (#9282) 2023-10-08 20:57:41 +00:00