From 309c224ca87abd6935bf0f6daf156118e88235f8 Mon Sep 17 00:00:00 2001 From: Mincong Lu <139340600+mintlu8@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:28:42 +0800 Subject: [PATCH] Added `get_main_animation` for `AnimationTransitions` (#14104) # Objective Added a getter for the main animation of `AnimationTransitions`. ## Solution Added `get_main_animation` for `AnimationTransitions`. --- crates/bevy_animation/src/transition.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/bevy_animation/src/transition.rs b/crates/bevy_animation/src/transition.rs index 1f3baf5478..03c05f78c4 100644 --- a/crates/bevy_animation/src/transition.rs +++ b/crates/bevy_animation/src/transition.rs @@ -93,6 +93,11 @@ impl AnimationTransitions { self.main_animation = Some(new_animation); player.start(new_animation) } + + /// Obtain the currently playing main animation. + pub fn get_main_animation(&self) -> Option { + self.main_animation + } } /// A system that alters the weight of currently-playing transitions based on