mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
transform: run transform systems at startup and move transform systems to POST_UPDATE
This commit is contained in:
parent
6cd5af6f74
commit
f72c4beadf
1 changed files with 6 additions and 2 deletions
|
@ -3,7 +3,7 @@ pub mod float_ord;
|
|||
pub mod time;
|
||||
pub mod transform;
|
||||
|
||||
use bevy_app::{stage, AppBuilder, AppPlugin};
|
||||
use bevy_app::{stage, startup_stage, AppBuilder, AppPlugin};
|
||||
use bevy_transform::{
|
||||
components::{
|
||||
Children, LocalTransform, NonUniformScale, Rotation, Scale, Transform, Translation,
|
||||
|
@ -20,8 +20,12 @@ pub struct CorePlugin;
|
|||
|
||||
impl AppPlugin for CorePlugin {
|
||||
fn build(&self, app: &mut AppBuilder) {
|
||||
// we also add a copy of transform systems to startup to ensure we begin with correct transform/parent state
|
||||
for transform_system in transform_system_bundle::build(app.world_mut()).drain(..) {
|
||||
app.add_system(transform_system);
|
||||
app.add_startup_system_to_stage(startup_stage::POST_STARTUP, transform_system);
|
||||
}
|
||||
for transform_system in transform_system_bundle::build(app.world_mut()).drain(..) {
|
||||
app.add_system_to_stage(stage::POST_UPDATE, transform_system);
|
||||
}
|
||||
|
||||
app.init_resource::<Time>()
|
||||
|
|
Loading…
Reference in a new issue