mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
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:
parent
3d72f494a2
commit
c4c1c8ffa1
2 changed files with 4 additions and 3 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue