From 52d6799544a93ef3e15a17e27dfba796c14725ff Mon Sep 17 00:00:00 2001 From: Jonathan Cornaz Date: Sun, 29 Nov 2020 23:07:47 +0100 Subject: [PATCH] Run parent-update and transform-propagation during the "post-startup" stage (instead of "startup") (#955) * Propagate transforms during the POST_STARTUP start-up stage * Update changelog --- CHANGELOG.md | 2 ++ crates/bevy_transform/src/lib.rs | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abacc17794..640464564c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ current changes on git with [previous release tags][git_tag_comparison]. - [Use `instant::Instant` for WASM compatibility][895] - [Fixed duplicated children when spawning a Scene][904] - [Corrected behaviour of the UI depth system][905] +- [Run parent-update and transform-propagation during the "post-startup" stage][955] [821]: https://github.com/bevyengine/bevy/pull/821 [829]: https://github.com/bevyengine/bevy/pull/829 @@ -59,6 +60,7 @@ current changes on git with [previous release tags][git_tag_comparison]. [926]: https://github.com/bevyengine/bevy/pull/926 [931]: https://github.com/bevyengine/bevy/pull/931 [934]: https://github.com/bevyengine/bevy/pull/934 +[955]: https://github.com/bevyengine/bevy/pull/955 ## Version 0.3.0 (2020-11-03) diff --git a/crates/bevy_transform/src/lib.rs b/crates/bevy_transform/src/lib.rs index 2e08097944..dd7126ac39 100644 --- a/crates/bevy_transform/src/lib.rs +++ b/crates/bevy_transform/src/lib.rs @@ -6,7 +6,7 @@ pub mod prelude { pub use crate::{components::*, hierarchy::*, TransformPlugin}; } -use bevy_app::prelude::*; +use bevy_app::{prelude::*, startup_stage}; use bevy_reflect::RegisterTypeBuilder; use prelude::{parent_update_system, Children, GlobalTransform, Parent, PreviousParent, Transform}; @@ -21,8 +21,11 @@ impl Plugin for TransformPlugin { .register_type::() .register_type::() // add transform systems to startup so the first update is "correct" - .add_startup_system(parent_update_system) - .add_startup_system(transform_propagate_system::transform_propagate_system) + .add_startup_system_to_stage(startup_stage::POST_STARTUP, parent_update_system) + .add_startup_system_to_stage( + startup_stage::POST_STARTUP, + transform_propagate_system::transform_propagate_system, + ) .add_system_to_stage(stage::POST_UPDATE, parent_update_system) .add_system_to_stage( stage::POST_UPDATE,