Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add labels and ordering for transform propagation and parent update systems in POST_UPDATE stage #1456

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions crates/bevy_transform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub mod prelude {

use bevy_app::{prelude::*, startup_stage};
use bevy_ecs::IntoSystem;
use bevy_ecs::ParallelSystemDescriptorCoercion;
use bevy_reflect::RegisterTypeBuilder;
use prelude::{parent_update_system, Children, GlobalTransform, Parent, PreviousParent, Transform};

Expand All @@ -22,15 +23,27 @@ impl Plugin for TransformPlugin {
.register_type::<Transform>()
.register_type::<GlobalTransform>()
// add transform systems to startup so the first update is "correct"
.add_startup_system_to_stage(startup_stage::POST_STARTUP, parent_update_system.system())
.add_startup_system_to_stage(
startup_stage::POST_STARTUP,
transform_propagate_system::transform_propagate_system.system(),
parent_update_system.system().label("parent_update_system"),
)
.add_startup_system_to_stage(
startup_stage::POST_STARTUP,
transform_propagate_system::transform_propagate_system
.system()
.label("transform_propagate_system")
.after("parent_update_system"),
)
.add_system_to_stage(
stage::POST_UPDATE,
parent_update_system.system().label("parent_update_system"),
)
.add_system_to_stage(stage::POST_UPDATE, parent_update_system.system())
.add_system_to_stage(
stage::POST_UPDATE,
transform_propagate_system::transform_propagate_system.system(),
transform_propagate_system::transform_propagate_system
.system()
.label("transform_propagate_system")
.after("parent_update_system"),
);
}
}