Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some missing reflect attributes #14259

Merged
merged 5 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/bevy_animation/src/transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<AnimationNodeIndex>,
transitions: Vec<AnimationTransition>,
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/world/component_constants.rs
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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;
2 changes: 1 addition & 1 deletion crates/bevy_ui/src/ui_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ impl Default for ZIndex {
///
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius>
#[derive(Component, Copy, Clone, Debug, PartialEq, Reflect)]
#[reflect(PartialEq, Default)]
#[reflect(Component, PartialEq, Default)]
#[cfg_attr(
feature = "serialize",
derive(serde::Serialize, serde::Deserialize),
Expand Down