chore: Update to Bevy 0.14.

This commit is contained in:
Nolan Darilek 2024-07-06 19:46:23 -05:00
parent 7ad2070fa9
commit a6de8e190c
2 changed files with 6 additions and 6 deletions

View File

@ -17,12 +17,12 @@ speech_dispatcher_0_11 = ["tts/speech_dispatcher_0_11"]
tolk = ["tts/tolk"]
[dependencies]
bevy = { version = "0.13", default-features = false }
bevy = { version = "0.14", default-features = false }
crossbeam-channel = "0.5"
tts = { version = "0.26", default-features = false }
[dev-dependencies]
bevy = { version = "0.13", default-features = true }
bevy = { version = "0.14", default-features = true }
[package.metadata.release]
publish = false

View File

@ -5,7 +5,7 @@ fn main() {
App::new()
.add_plugins((DefaultPlugins, bevy_tts::TtsPlugin))
.add_systems(Startup, setup)
.add_systems(Update, (bevy::window::close_on_esc, event_poll, greet))
.add_systems(Update, (event_poll, greet))
.run();
}
@ -61,14 +61,14 @@ fn setup(mut tts: ResMut<Tts>) {
// Reports events from TTS subsystem.
fn event_poll(mut events: EventReader<TtsEvent>) {
for event in events.iter() {
for event in events.read() {
println!("{:?}", event);
}
}
// Shows how to output speech in response to a keypress.
fn greet(input: Res<Input<KeyCode>>, mut tts: ResMut<Tts>) {
if input.just_pressed(KeyCode::G) {
fn greet(input: Res<ButtonInput<KeyCode>>, mut tts: ResMut<Tts>) {
if input.just_pressed(KeyCode::KeyG) {
tts.speak("Hey there!", true).unwrap();
}
}