I have a system that depends on a Component that wraps a InstanceId, and on it I check if the InstanceId is ready, and if not, I call set_changed on the Component expecting it to run again on the next frame, but it does not
fn update_modular<T: Component + Deref<Target = InstanceId>>(
mut changed_modular: Query<(Entity, &mut T), Changed<T>>,
children: Query<(Option<&Name>, &Children)>,
mut scene_spawner: ResMut<SceneSpawner>,
) {
for (entity, mut modular) in &mut changed_modular {
println!("Changed {:?}", entity);
if scene_spawner.instance_is_ready(**modular) {
println!("Instance ready");
// Move mesh to parent
todo!();
} else {
println!("Instance not ready");
modular.set_changed();
}
}
}
Output
Changed 2v1
Instance not ready
No change of behavior by removing the generic