Undeprecate is_playing_animation (#16121)

# Objective

- Fixes #16098

## Solution

- Undeprecate `is_playing_animation` and copy the docs from
`animation_is_playing` to it.

## Testing

- CI

## Migration


68e9a34e30/release-content/0.15/migration-guides/_guides.toml (L13-L17)
needs to be removed.
This commit is contained in:
mgi388 2024-10-28 09:38:07 +11:00 committed by GitHub
parent 3d72f494a2
commit c4c1c8ffa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -856,8 +856,8 @@ impl AnimationPlayer {
self.active_animations.iter_mut() self.active_animations.iter_mut()
} }
#[deprecated = "Use `animation_is_playing` instead"] /// Returns true if the animation is currently playing or paused, or false
/// Check if the given animation node is being played. /// if the animation is stopped.
pub fn is_playing_animation(&self, animation: AnimationNodeIndex) -> bool { pub fn is_playing_animation(&self, animation: AnimationNodeIndex) -> bool {
self.active_animations.contains_key(&animation) self.active_animations.contains_key(&animation)
} }
@ -944,6 +944,7 @@ impl AnimationPlayer {
self.active_animations.get_mut(&animation) self.active_animations.get_mut(&animation)
} }
#[deprecated = "Use `is_playing_animation` instead"]
/// Returns true if the animation is currently playing or paused, or false /// Returns true if the animation is currently playing or paused, or false
/// if the animation is stopped. /// if the animation is stopped.
pub fn animation_is_playing(&self, animation: AnimationNodeIndex) -> bool { pub fn animation_is_playing(&self, animation: AnimationNodeIndex) -> bool {

View file

@ -452,7 +452,7 @@ fn sync_weights(mut query: Query<(&mut AnimationPlayer, &ExampleAnimationWeights
.zip(animation_weights.weights.iter()) .zip(animation_weights.weights.iter())
{ {
// If the animation happens to be no longer active, restart it. // If the animation happens to be no longer active, restart it.
if !animation_player.animation_is_playing(animation_node_index.into()) { if !animation_player.is_playing_animation(animation_node_index.into()) {
animation_player.play(animation_node_index.into()); animation_player.play(animation_node_index.into());
} }