diff --git a/crates/bevy_app/src/propagate.rs b/crates/bevy_app/src/propagate.rs index c6ac5139b92e8..2cfaf6bda767e 100644 --- a/crates/bevy_app/src/propagate.rs +++ b/crates/bevy_app/src/propagate.rs @@ -8,10 +8,12 @@ use bevy_ecs::{ hierarchy::ChildOf, lifecycle::RemovedComponents, query::{Changed, Or, QueryFilter, With, Without}, + reflect::ReflectComponent, relationship::{Relationship, RelationshipTarget}, schedule::{IntoScheduleConfigs, SystemSet}, system::{Commands, Local, Query}, }; +use bevy_reflect::Reflect; /// Plugin to automatically propagate a component value to all direct and transient relationship /// targets (e.g. [`bevy_ecs::hierarchy::Children`]) of entities with a [`Propagate`] component. @@ -38,15 +40,22 @@ pub struct HierarchyPropagatePlugin< /// targets. A target with a [`Propagate`] component of its own will override propagation from /// that point in the tree. #[derive(Component, Clone, PartialEq)] +#[cfg_attr( + feature = "bevy_reflect", + derive(Reflect), + reflect(Component, Clone, PartialEq) +)] pub struct Propagate(pub C); /// Stops the output component being added to this entity. /// Relationship targets will still inherit the component from this entity or its parents. #[derive(Component)] +#[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Component))] pub struct PropagateOver(PhantomData C>); /// Stops the propagation at this entity. Children will not inherit the component. #[derive(Component)] +#[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Component))] pub struct PropagateStop(PhantomData C>); /// The set in which propagation systems are added. You can schedule your logic relative to this set. @@ -57,6 +66,11 @@ pub struct PropagateSet { /// Internal struct for managing propagation #[derive(Component, Clone, PartialEq)] +#[cfg_attr( + feature = "bevy_reflect", + derive(Reflect), + reflect(Component, Clone, PartialEq) +)] pub struct Inherited(pub C); impl Default