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_transform (#15230)
Fixes https://github.com/bevyengine/bevy/issues/15187 for bevy_transform
This commit is contained in:
parent
cb6ab16c97
commit
5a0c09d38f
2 changed files with 13 additions and 3 deletions
|
@ -6,6 +6,8 @@ use bevy_ecs::{component::Component, reflect::ReflectComponent};
|
||||||
use bevy_math::{Affine3A, Dir3, Isometry3d, Mat4, Quat, Vec3, Vec3A};
|
use bevy_math::{Affine3A, Dir3, Isometry3d, Mat4, Quat, Vec3, Vec3A};
|
||||||
#[cfg(feature = "bevy-support")]
|
#[cfg(feature = "bevy-support")]
|
||||||
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
||||||
|
#[cfg(all(feature = "bevy-support", feature = "serialize"))]
|
||||||
|
use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
|
||||||
|
|
||||||
/// [`GlobalTransform`] is an affine transformation from entity-local coordinates to worldspace coordinates.
|
/// [`GlobalTransform`] is an affine transformation from entity-local coordinates to worldspace coordinates.
|
||||||
///
|
///
|
||||||
|
@ -39,7 +41,11 @@ use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "bevy-support",
|
feature = "bevy-support",
|
||||||
derive(Component, Reflect),
|
derive(Component, Reflect),
|
||||||
reflect(Component, Default, PartialEq)
|
reflect(Component, Default, PartialEq, Debug)
|
||||||
|
)]
|
||||||
|
#[cfg_attr(
|
||||||
|
all(feature = "bevy-support", feature = "serialize"),
|
||||||
|
reflect(Serialize, Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct GlobalTransform(Affine3A);
|
pub struct GlobalTransform(Affine3A);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ use super::GlobalTransform;
|
||||||
use bevy_ecs::{component::Component, reflect::ReflectComponent};
|
use bevy_ecs::{component::Component, reflect::ReflectComponent};
|
||||||
use bevy_math::{Affine3A, Dir3, Isometry3d, Mat3, Mat4, Quat, Vec3};
|
use bevy_math::{Affine3A, Dir3, Isometry3d, Mat3, Mat4, Quat, Vec3};
|
||||||
#[cfg(feature = "bevy-support")]
|
#[cfg(feature = "bevy-support")]
|
||||||
use bevy_reflect::{prelude::*, Reflect};
|
use bevy_reflect::prelude::*;
|
||||||
use std::ops::Mul;
|
use std::ops::Mul;
|
||||||
|
|
||||||
/// Describe the position of an entity. If the entity has a parent, the position is relative
|
/// Describe the position of an entity. If the entity has a parent, the position is relative
|
||||||
|
@ -38,7 +38,11 @@ use std::ops::Mul;
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "bevy-support",
|
feature = "bevy-support",
|
||||||
derive(Component, Reflect),
|
derive(Component, Reflect),
|
||||||
reflect(Component, Default, PartialEq)
|
reflect(Component, Default, PartialEq, Debug)
|
||||||
|
)]
|
||||||
|
#[cfg_attr(
|
||||||
|
all(feature = "bevy-support", feature = "serialize"),
|
||||||
|
reflect(Serialize, Deserialize)
|
||||||
)]
|
)]
|
||||||
pub struct Transform {
|
pub struct Transform {
|
||||||
/// Position of the entity. In 2d, the last value of the `Vec3` is used for z-ordering.
|
/// Position of the entity. In 2d, the last value of the `Vec3` is used for z-ordering.
|
||||||
|
|
Loading…
Reference in a new issue