add labels and ordering for transform and parent systems in POST_UPDATE stage (#1456)

This commit is contained in:
François 2021-02-17 03:00:12 +01:00 committed by GitHub
parent a895256925
commit a5d2501b75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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};
@ -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())
.add_system_to_stage(
stage::POST_UPDATE,
transform_propagate_system::transform_propagate_system.system(),
parent_update_system.system().label("parent_update_system"),
)
.add_system_to_stage(
stage::POST_UPDATE,
transform_propagate_system::transform_propagate_system
.system()
.label("transform_propagate_system")
.after("parent_update_system"),
);
}
}