Skip to content
Open
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
9 changes: 4 additions & 5 deletions examples/tools/scene_viewer/animation_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,14 @@ fn handle_inputs(
if keyboard_input.just_pressed(KeyCode::Enter) {
info!("switching to new animation for {display_entity_name}");

let resume = !player.all_paused();
// set the current animation to its start and pause it to reset to its starting state
player.rewind_all().pause_all();
let paused = player.all_paused();
player.stop_all();

clips.advance_to_next();
let current_clip = clips.current();
player.play(current_clip).repeat();
if resume {
player.resume_all();
if paused {
player.pause_all();
}
}
}
Expand Down
Loading