mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Reflect derived traits on all components and resources: bevy_hierarchy (#15219)
Solves https://github.com/bevyengine/bevy/issues/15187 for bevy_hierarchy
This commit is contained in:
parent
e718bbd55c
commit
62b2cdab32
2 changed files with 7 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
#[cfg(feature = "reflect")]
|
#[cfg(feature = "reflect")]
|
||||||
use bevy_ecs::reflect::{ReflectComponent, ReflectMapEntities};
|
use bevy_ecs::reflect::{ReflectComponent, ReflectFromWorld, ReflectMapEntities};
|
||||||
use bevy_ecs::{
|
use bevy_ecs::{
|
||||||
component::Component,
|
component::Component,
|
||||||
entity::{Entity, EntityMapper, MapEntities},
|
entity::{Entity, EntityMapper, MapEntities},
|
||||||
|
@ -25,7 +25,7 @@ use std::ops::Deref;
|
||||||
/// [`BuildChildren::with_children`]: crate::child_builder::BuildChildren::with_children
|
/// [`BuildChildren::with_children`]: crate::child_builder::BuildChildren::with_children
|
||||||
#[derive(Component, Debug)]
|
#[derive(Component, Debug)]
|
||||||
#[cfg_attr(feature = "reflect", derive(bevy_reflect::Reflect))]
|
#[cfg_attr(feature = "reflect", derive(bevy_reflect::Reflect))]
|
||||||
#[cfg_attr(feature = "reflect", reflect(Component, MapEntities))]
|
#[cfg_attr(feature = "reflect", reflect(Component, MapEntities, Debug, FromWorld))]
|
||||||
pub struct Children(pub(crate) SmallVec<[Entity; 8]>);
|
pub struct Children(pub(crate) SmallVec<[Entity; 8]>);
|
||||||
|
|
||||||
impl MapEntities for Children {
|
impl MapEntities for Children {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#[cfg(feature = "reflect")]
|
#[cfg(feature = "reflect")]
|
||||||
use bevy_ecs::reflect::{ReflectComponent, ReflectMapEntities};
|
use bevy_ecs::reflect::{ReflectComponent, ReflectFromWorld, ReflectMapEntities};
|
||||||
use bevy_ecs::{
|
use bevy_ecs::{
|
||||||
component::Component,
|
component::Component,
|
||||||
entity::{Entity, EntityMapper, MapEntities},
|
entity::{Entity, EntityMapper, MapEntities},
|
||||||
|
@ -23,7 +23,10 @@ use std::ops::Deref;
|
||||||
/// [`BuildChildren::with_children`]: crate::child_builder::BuildChildren::with_children
|
/// [`BuildChildren::with_children`]: crate::child_builder::BuildChildren::with_children
|
||||||
#[derive(Component, Debug, Eq, PartialEq)]
|
#[derive(Component, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(feature = "reflect", derive(bevy_reflect::Reflect))]
|
#[cfg_attr(feature = "reflect", derive(bevy_reflect::Reflect))]
|
||||||
#[cfg_attr(feature = "reflect", reflect(Component, MapEntities, PartialEq))]
|
#[cfg_attr(
|
||||||
|
feature = "reflect",
|
||||||
|
reflect(Component, MapEntities, PartialEq, Debug, FromWorld)
|
||||||
|
)]
|
||||||
pub struct Parent(pub(crate) Entity);
|
pub struct Parent(pub(crate) Entity);
|
||||||
|
|
||||||
impl Parent {
|
impl Parent {
|
||||||
|
|
Loading…
Reference in a new issue