Public access for AnimationClip.duration (#4615)

# Objective

- Small change that better facilitates custom animation systems

## Solution

- Added a public access function to `bevy::animation::AnimationClip`, making duration publicly readable

---
This commit is contained in:
Spooky Th Ghost 2022-04-27 17:37:30 +00:00
parent 328c26d02c
commit 8e03634457

View file

@ -73,6 +73,11 @@ impl AnimationClip {
&self.curves
}
/// Duration of the clip, represented in seconds
pub fn duration(&self) -> &f32 {
&self.duration
}
/// Add a [`VariableCurve`] to an [`EntityPath`].
pub fn add_curve_to_path(&mut self, path: EntityPath, curve: VariableCurve) {
// Update the duration of the animation by this curve duration if it's longer