Skip to content

Commit adb249c

Browse files
authored
enable change detection for labels (#1155)
1 parent b94f266 commit adb249c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/bevy_core/src/label.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ impl EntityLabels {
7474

7575
pub(crate) fn entity_labels_system(
7676
mut entity_labels: ResMut<EntityLabels>,
77-
// the system runs in an early stage and so can't use a Changed<Labels> filter
78-
query: Query<(Entity, &Labels)>,
77+
query: Query<(Entity, &Labels), Changed<Labels>>,
7978
) {
8079
let entity_labels = entity_labels.deref_mut();
8180

crates/bevy_core/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub mod prelude {
1818
pub use crate::{DefaultTaskPoolOptions, EntityLabels, Labels, Time, Timer};
1919
}
2020

21-
use bevy_app::prelude::*;
21+
use bevy_app::{prelude::*, startup_stage};
2222

2323
/// Adds core functionality to Apps.
2424
#[derive(Default)]
@@ -40,6 +40,7 @@ impl Plugin for CorePlugin {
4040
.register_type::<Range<f32>>()
4141
.register_type::<Timer>()
4242
.add_system_to_stage(stage::FIRST, time_system.system())
43-
.add_system_to_stage(stage::PRE_UPDATE, entity_labels_system.system());
43+
.add_startup_system_to_stage(startup_stage::POST_STARTUP, entity_labels_system.system())
44+
.add_system_to_stage(stage::POST_UPDATE, entity_labels_system.system());
4445
}
4546
}

0 commit comments

Comments
 (0)