From 3d145812ad40e91a9db6759a7f01214ba3de3e38 Mon Sep 17 00:00:00 2001 From: Joona Aalto Date: Sun, 21 Jul 2024 23:17:26 +0300 Subject: [PATCH] Register `AncestorMarker` --- src/sync/ancestor_marker.rs | 8 ++++++++ src/type_registration.rs | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/sync/ancestor_marker.rs b/src/sync/ancestor_marker.rs index d3f6636f..bb671f7a 100644 --- a/src/sync/ancestor_marker.rs +++ b/src/sync/ancestor_marker.rs @@ -99,10 +99,18 @@ impl Plugin for AncestorMarkerPlugin { /// /// This is added and removed automatically by the [`AncestorMarkerPlugin`] if it is enabled. #[derive(Component, Reflect)] +#[reflect(Component, Default)] pub struct AncestorMarker { + #[reflect(ignore)] _phantom: PhantomData, } +impl Clone for AncestorMarker { + fn clone(&self) -> Self { + Self::default() + } +} + impl Default for AncestorMarker { fn default() -> Self { Self { diff --git a/src/type_registration.rs b/src/type_registration.rs index d6d912b4..9d5840fc 100644 --- a/src/type_registration.rs +++ b/src/type_registration.rs @@ -1,6 +1,6 @@ use crate::{ prelude::*, - sync::{PreviousGlobalTransform, SyncConfig}, + sync::{ancestor_marker::AncestorMarker, PreviousGlobalTransform, SyncConfig}, }; use bevy::prelude::*; use broad_phase::AabbIntersections; @@ -68,6 +68,8 @@ impl Plugin for PhysicsTypeRegistrationPlugin { .register_type::() .register_type::() .register_type::() + .register_type::>() + .register_type::>() .register_type::() .register_type::() .register_type::()