Skip to content

Commit

Permalink
animator play/start (14546)
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Aug 15, 2024
1 parent 2dd2880 commit f3082ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,14 @@ thread_local! {
impl AnimationPlayer {
/// Start playing an animation, restarting it if necessary.
pub fn start(&mut self, animation: AnimationNodeIndex) -> &mut ActiveAnimation {
self.active_animations.entry(animation).or_default()
let playing_animation = self.active_animations.entry(animation).or_default();
playing_animation.replay();
playing_animation
}

/// Start playing an animation, unless the requested animation is already playing.
pub fn play(&mut self, animation: AnimationNodeIndex) -> &mut ActiveAnimation {
let playing_animation = self.active_animations.entry(animation).or_default();
playing_animation.weight = 1.0;
playing_animation
self.active_animations.entry(animation).or_default()
}

/// Stops playing the given animation, removing it from the list of playing
Expand Down

0 comments on commit f3082ff

Please sign in to comment.