diff --git a/crates/bevy_animation/src/transition.rs b/crates/bevy_animation/src/transition.rs index 03c05f78c4531..f419f6e9c9dc1 100644 --- a/crates/bevy_animation/src/transition.rs +++ b/crates/bevy_animation/src/transition.rs @@ -5,9 +5,10 @@ use bevy_ecs::{ component::Component, + reflect::ReflectComponent, system::{Query, Res}, }; -use bevy_reflect::Reflect; +use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_time::Time; use bevy_utils::Duration; @@ -28,6 +29,7 @@ use crate::{graph::AnimationNodeIndex, ActiveAnimation, AnimationPlayer}; /// component to get confused about which animation is the "main" animation, and /// transitions will usually be incorrect as a result. #[derive(Component, Default, Reflect)] +#[reflect(Component, Default)] pub struct AnimationTransitions { main_animation: Option, transitions: Vec, diff --git a/crates/bevy_ecs/src/world/component_constants.rs b/crates/bevy_ecs/src/world/component_constants.rs index 00dee013081c4..28103c02379e0 100644 --- a/crates/bevy_ecs/src/world/component_constants.rs +++ b/crates/bevy_ecs/src/world/component_constants.rs @@ -1,5 +1,7 @@ use super::*; use crate::{self as bevy_ecs}; +#[cfg(feature = "bevy_reflect")] +use bevy_reflect::Reflect; /// Internal components used by bevy with a fixed component id. /// Constants are used to skip [`TypeId`] lookups in hot paths. @@ -12,12 +14,15 @@ pub const ON_REMOVE: ComponentId = ComponentId::new(2); /// Trigger emitted when a component is added to an entity. #[derive(Event)] +#[cfg_attr(feature = "bevy_reflect", derive(Reflect))] pub struct OnAdd; /// Trigger emitted when a component is inserted onto an entity. #[derive(Event)] +#[cfg_attr(feature = "bevy_reflect", derive(Reflect))] pub struct OnInsert; /// Trigger emitted when a component is removed from an entity. #[derive(Event)] +#[cfg_attr(feature = "bevy_reflect", derive(Reflect))] pub struct OnRemove; diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index 5e918e4d1ca8e..8aad2fb8305d1 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -1988,7 +1988,7 @@ impl Default for ZIndex { /// /// #[derive(Component, Copy, Clone, Debug, PartialEq, Reflect)] -#[reflect(PartialEq, Default)] +#[reflect(Component, PartialEq, Default)] #[cfg_attr( feature = "serialize", derive(serde::Serialize, serde::Deserialize),