Invert the dependency between bevy_animation and bevy_ui (#15634)

# Objective

- Improve crate dependency graph

## Solution

- Invert a dependency

## Testing

- Tested ui and animation examples
This commit is contained in:
vero 2024-10-03 21:27:20 -04:00 committed by GitHub
parent 61e11ea440
commit 0b9a461d5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 7 deletions

View file

@ -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

View file

@ -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),
);
}
}

View file

@ -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 }

View file

@ -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,
)