Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FMOD Studio Examples #33

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target/
assets/
*.lib
*.dll
demo_project/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ bevy_fmod = { git = "https://github.com/Salzian/bevy_fmod.git", tag = "v0.1.0" }

## Examples

This repository includes a `hello_world` example. In order to run it, you need
to [download the demo project][demo_project] (Google Drive link) and place it into the root of the
project: `./demo_project`.
FMOD Studio comes with an Examples project. Open it and build the project. Then put the bank files inside the assets folder of this repository.
You can also configure FMOD Studio to build to a folder you specify.
Run examples with `cargo run --example`. See the source code of the examples for more details.

## Versioning

Expand Down
7 changes: 4 additions & 3 deletions examples/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ fn main() {
DefaultPlugins,
FmodPlugin {
audio_banks_paths: &[
"./demo_project/Build/Desktop/Master.bank",
"./demo_project/Build/Desktop/Master.strings.bank",
"./assets/Master.bank",
"./assets/Master.strings.bank",
"./assets/Music.bank",
],
},
))
Expand All @@ -29,7 +30,7 @@ fn main() {
struct MyMusicPlayer;

fn startup(mut commands: Commands, studio: Res<FmodStudio>) {
let event_description = studio.0.get_event("event:/Return").unwrap();
let event_description = studio.0.get_event("event:/Music/Level 03").unwrap();

commands
.spawn(MyMusicPlayer)
Expand Down
7 changes: 4 additions & 3 deletions examples/spatial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ fn main() {
DefaultPlugins,
FmodPlugin {
audio_banks_paths: &[
"./demo_project/Build/Desktop/Master.bank",
"./demo_project/Build/Desktop/Master.strings.bank",
"./assets/Master.bank",
"./assets/Master.strings.bank",
"./assets/Music.bank",
],
},
))
Expand All @@ -52,7 +53,7 @@ fn spawn_sound(
studio: Res<FmodStudio>,
input: Res<Input<KeyCode>>,
) {
let event_description = studio.0.get_event("event:/Return").unwrap();
let event_description = studio.0.get_event("event:/Music/Radio Station").unwrap();

if input.just_pressed(KeyCode::F) {
commands.spawn((
Expand Down