diff --git a/crates/bevy_ecs/src/change_detection.rs b/crates/bevy_ecs/src/change_detection.rs index 3cf2fecc49d00..0f86a7f7374d9 100644 --- a/crates/bevy_ecs/src/change_detection.rs +++ b/crates/bevy_ecs/src/change_detection.rs @@ -1,6 +1,7 @@ //! Types that detect when their internal data mutate. use crate::component::{Component, ComponentTicks}; +#[cfg(feature = "bevy_reflect")] use bevy_reflect::Reflect; use std::ops::{Deref, DerefMut}; @@ -187,10 +188,12 @@ change_detection_impl!(Mut<'a, T>, T,); impl_into_inner!(Mut<'a, T>, T,); impl_debug!(Mut<'a, T>,); +#[cfg(feature = "bevy_reflect")] /// Unique mutable borrow of a Reflected component pub struct ReflectMut<'a> { pub(crate) value: &'a mut dyn Reflect, pub(crate) ticks: Ticks<'a>, } +#[cfg(feature = "bevy_reflect")] change_detection_impl!(ReflectMut<'a>, dyn Reflect,);