bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
34.94k stars 3.41k forks source link

Deprecate either `animation_is_playing` or `is_playing_animation` from AnimationPlayer #14386

Closed FastestMolasses closed 1 month ago

FastestMolasses commented 1 month ago

How can Bevy's documentation be improved?

/// Returns true if the animation is currently playing or paused, or false
/// if the animation is stopped.
pub fn animation_is_playing(&self, animation: AnimationNodeIndex) -> bool {
    self.active_animations.contains_key(&animation)
}

/// Check if the given animation node is being played.
pub fn is_playing_animation(&self, animation: AnimationNodeIndex) -> bool {
    self.active_animations.contains_key(&animation)
}

These functions implemented in AnimationPlayer are equivalent, just named differently.

https://github.com/bevyengine/bevy/blob/main/crates/bevy_animation/src/lib.rs#L607 https://github.com/bevyengine/bevy/blob/main/crates/bevy_animation/src/lib.rs#L695

FastestMolasses commented 1 month ago

The documentation for animation_is_playing is more informative and the function name flows better in code in my opinion.