diff --git a/Cargo.toml b/Cargo.toml index 12d8ef458f0d3..724dca1182a79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1819,6 +1819,18 @@ description = "Plays an animation from a glTF file with meshes with morph target category = "Animation" wasm = true + +[[example]] +name = "animated_multiple_time_res" +path = "examples/animation/animated_multiple_time_res.rs" +doc-scrape-examples = true + +[package.metadata.example.animated_multiple_time_res] +name = "Animation with different Time resources" +description = "Plays an animations where each of them is using a different Time resource" +category = "Animation" +wasm = true + [[example]] name = "animated_transform" path = "examples/animation/animated_transform.rs" diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index f5c196380fb9e..2ad732a47edc3 100644 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -1043,13 +1043,21 @@ fn trigger_untargeted_animation_events( } } +/// Marker component for animations that should not use the default animation time. +/// For more details, see the [`TimeDependentAnimationPlugin`] documentation. +#[derive(Debug, Component, Reflect, Clone, Copy, Default)] +#[reflect(Component)] +pub struct ExplicitAnimationTime; + /// A system that advances the time for all playing animations. -pub fn advance_animations( - time: Res