diff --git a/crates/bevy_animation/Cargo.toml b/crates/bevy_animation/Cargo.toml index 66d20c49fe..d507f03342 100644 --- a/crates/bevy_animation/Cargo.toml +++ b/crates/bevy_animation/Cargo.toml @@ -27,9 +27,6 @@ bevy_utils = { path = "../bevy_utils", version = "0.15.0-dev" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-dev" } bevy_transform = { path = "../bevy_transform", version = "0.15.0-dev" } bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.15.0-dev" } -bevy_ui = { path = "../bevy_ui", version = "0.15.0-dev", features = [ - "bevy_text", -] } bevy_text = { path = "../bevy_text", version = "0.15.0-dev" } # other diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index 2358543204..529377cab7 100755 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -44,7 +44,6 @@ use bevy_reflect::{ }; use bevy_time::Time; use bevy_transform::{prelude::Transform, TransformSystem}; -use bevy_ui::UiSystem; use bevy_utils::{ hashbrown::HashMap, tracing::{trace, warn}, @@ -1043,6 +1042,10 @@ pub fn animate_targets( }); } +/// Animation system set +#[derive(SystemSet, Debug, Hash, PartialEq, Eq, Clone)] +pub struct Animation; + /// Adds animation support to an app #[derive(Default)] pub struct AnimationPlugin; @@ -1078,8 +1081,8 @@ impl Plugin for AnimationPlugin { expire_completed_transitions, ) .chain() - .before(TransformSystem::TransformPropagate) - .before(UiSystem::Prepare), + .in_set(Animation) + .before(TransformSystem::TransformPropagate), ); } } diff --git a/crates/bevy_ui/Cargo.toml b/crates/bevy_ui/Cargo.toml index c0d95b85d6..2ee274d4ba 100644 --- a/crates/bevy_ui/Cargo.toml +++ b/crates/bevy_ui/Cargo.toml @@ -24,6 +24,7 @@ bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-dev", features = [ "bevy", ] } bevy_render = { path = "../bevy_render", version = "0.15.0-dev" } +bevy_animation = { path = "../bevy_animation", version = "0.15.0-dev" } bevy_sprite = { path = "../bevy_sprite", version = "0.15.0-dev" } bevy_text = { path = "../bevy_text", version = "0.15.0-dev", optional = true } bevy_picking = { path = "../bevy_picking", version = "0.15.0-dev", optional = true } diff --git a/crates/bevy_ui/src/lib.rs b/crates/bevy_ui/src/lib.rs index c2a773ba5a..7120dd9f05 100644 --- a/crates/bevy_ui/src/lib.rs +++ b/crates/bevy_ui/src/lib.rs @@ -152,7 +152,9 @@ impl Plugin for UiPlugin { PostUpdate, ( CameraUpdateSystem, - UiSystem::Prepare.before(UiSystem::Stack), + UiSystem::Prepare + .before(UiSystem::Stack) + .after(bevy_animation::Animation), UiSystem::Layout, UiSystem::PostLayout, )