From 897625c899266481bfcf8386a1c8691cb565f34a Mon Sep 17 00:00:00 2001 From: Lubba64 <75751722+Lubba-64@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:31:13 -0400 Subject: [PATCH] Add `Reflect` to `OnReplace` (#14620) # Objective - Fixes #14337 ## Solution - Add a `cfg_attr` that derives `Refect` for this type. ## Testing - I am going to make sure the tests pass on this PR before requesting review, If more testing is necessary let me know some good action steps to take. --- crates/bevy_ecs/src/world/component_constants.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bevy_ecs/src/world/component_constants.rs b/crates/bevy_ecs/src/world/component_constants.rs index ad2da3e34f9b7..92c1572b0935b 100644 --- a/crates/bevy_ecs/src/world/component_constants.rs +++ b/crates/bevy_ecs/src/world/component_constants.rs @@ -29,6 +29,7 @@ pub struct OnInsert; /// Trigger emitted when a component is replaced on an entity. See [`crate::component::ComponentHooks::on_replace`] /// for more information. #[derive(Event)] +#[cfg_attr(feature = "bevy_reflect", derive(Reflect))] pub struct OnReplace; /// Trigger emitted when a component is removed from an entity. See [`crate::component::ComponentHooks::on_remove`]