Skip to content

Commit 8e03634

Browse files
committed
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 ---
1 parent 328c26d commit 8e03634

File tree

1 file changed

+5
-0
lines changed
  • crates/bevy_animation/src

1 file changed

+5
-0
lines changed

crates/bevy_animation/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ impl AnimationClip {
7373
&self.curves
7474
}
7575

76+
/// Duration of the clip, represented in seconds
77+
pub fn duration(&self) -> &f32 {
78+
&self.duration
79+
}
80+
7681
/// Add a [`VariableCurve`] to an [`EntityPath`].
7782
pub fn add_curve_to_path(&mut self, path: EntityPath, curve: VariableCurve) {
7883
// Update the duration of the animation by this curve duration if it's longer

0 commit comments

Comments
 (0)