Added clone bounds to EntityEvents that were missing them. (#19708)
# Objective Lack of clone on certain builtin events ## Solution Added clone to those events ## Testing ## Showcase
This commit is contained in:
parent
66086a2616
commit
f3e7a4b048
@ -461,7 +461,7 @@ pub(crate) fn slider_on_insert_step(trigger: On<Insert, SliderStep>, 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),
|
||||
|
@ -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")]
|
||||
|
Loading…
Reference in New Issue
Block a user