Skip to content

Commit ce5254e

Browse files
authored
Added get_main_animation for AnimationTransitions (#14104)
# Objective Added a getter for the main animation of `AnimationTransitions`. ## Solution Added `get_main_animation` for `AnimationTransitions`.
1 parent 1d907c5 commit ce5254e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/bevy_animation/src/transition.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ impl AnimationTransitions {
9393
self.main_animation = Some(new_animation);
9494
player.start(new_animation)
9595
}
96+
97+
/// Obtain the currently playing main animation.
98+
pub fn get_main_animation(&self) -> Option<AnimationNodeIndex> {
99+
self.main_animation
100+
}
96101
}
97102

98103
/// A system that alters the weight of currently-playing transitions based on

0 commit comments

Comments
 (0)