diff --git a/crates/bevy_core_widgets/src/core_slider.rs b/crates/bevy_core_widgets/src/core_slider.rs index e07a61a9c2..ecd6d52fbe 100644 --- a/crates/bevy_core_widgets/src/core_slider.rs +++ b/crates/bevy_core_widgets/src/core_slider.rs @@ -461,7 +461,7 @@ pub(crate) fn slider_on_insert_step(trigger: On, mut world: /// commands.trigger_targets(SetSliderValue::Relative(-0.25), slider); /// } /// ``` -#[derive(Event, EntityEvent)] +#[derive(Event, EntityEvent, Clone)] pub enum SetSliderValue { /// Set the slider value to a specific value. Absolute(f32), diff --git a/crates/bevy_ecs/src/lifecycle.rs b/crates/bevy_ecs/src/lifecycle.rs index be5765beee..e92c6cc7f9 100644 --- a/crates/bevy_ecs/src/lifecycle.rs +++ b/crates/bevy_ecs/src/lifecycle.rs @@ -328,7 +328,7 @@ pub const DESPAWN: ComponentId = ComponentId::new(4); /// Trigger emitted when a component is inserted onto an entity that does not already have that /// component. Runs before `Insert`. /// See [`crate::lifecycle::ComponentHooks::on_add`] for more information. -#[derive(Event, EntityEvent, Debug)] +#[derive(Event, EntityEvent, Debug, Clone)] #[cfg_attr(feature = "bevy_reflect", derive(Reflect))] #[cfg_attr(feature = "bevy_reflect", reflect(Debug))] #[doc(alias = "OnAdd")] @@ -337,7 +337,7 @@ pub struct Add; /// Trigger emitted when a component is inserted, regardless of whether or not the entity already /// had that component. Runs after `Add`, if it ran. /// See [`crate::lifecycle::ComponentHooks::on_insert`] for more information. -#[derive(Event, EntityEvent, Debug)] +#[derive(Event, EntityEvent, Debug, Clone)] #[cfg_attr(feature = "bevy_reflect", derive(Reflect))] #[cfg_attr(feature = "bevy_reflect", reflect(Debug))] #[doc(alias = "OnInsert")] @@ -348,7 +348,7 @@ pub struct Insert; /// /// Runs before the value is replaced, so you can still access the original component data. /// See [`crate::lifecycle::ComponentHooks::on_replace`] for more information. -#[derive(Event, EntityEvent, Debug)] +#[derive(Event, EntityEvent, Debug, Clone)] #[cfg_attr(feature = "bevy_reflect", derive(Reflect))] #[cfg_attr(feature = "bevy_reflect", reflect(Debug))] #[doc(alias = "OnReplace")] @@ -357,7 +357,7 @@ pub struct Replace; /// Trigger emitted when a component is removed from an entity, and runs before the component is /// removed, so you can still access the component data. /// See [`crate::lifecycle::ComponentHooks::on_remove`] for more information. -#[derive(Event, EntityEvent, Debug)] +#[derive(Event, EntityEvent, Debug, Clone)] #[cfg_attr(feature = "bevy_reflect", derive(Reflect))] #[cfg_attr(feature = "bevy_reflect", reflect(Debug))] #[doc(alias = "OnRemove")] @@ -365,7 +365,7 @@ pub struct Remove; /// Trigger emitted for each component on an entity when it is despawned. /// See [`crate::lifecycle::ComponentHooks::on_despawn`] for more information. -#[derive(Event, EntityEvent, Debug)] +#[derive(Event, EntityEvent, Debug, Clone)] #[cfg_attr(feature = "bevy_reflect", derive(Reflect))] #[cfg_attr(feature = "bevy_reflect", reflect(Debug))] #[doc(alias = "OnDespawn")]