From 7b934424754ef9536872d997f07b8b180da525e9 Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 10 Oct 2022 16:34:22 +0000 Subject: [PATCH] Fixes Camera not being serializable due to missing registrations in core functionality. (#6170) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … # Objective - Fixes Camera not being serializable due to missing registrations in core functionality. - Fixes #6169 ## Solution - Updated Bevy_Render CameraPlugin with registrations for Option and then Bevy_Core CorePlugin with registrations for ReflectSerialize and ReflectDeserialize for type data Range respectively according to the solution in #6169 Co-authored-by: Noah --- crates/bevy_core/src/lib.rs | 7 ++++++- crates/bevy_render/src/camera/mod.rs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs index 8fc580848fce9b..58ece9d81f111e 100644 --- a/crates/bevy_core/src/lib.rs +++ b/crates/bevy_core/src/lib.rs @@ -17,6 +17,7 @@ pub mod prelude { use bevy_app::prelude::*; use bevy_ecs::entity::Entity; +use bevy_reflect::{ReflectDeserialize, ReflectSerialize}; use bevy_utils::{Duration, HashSet, Instant}; use std::borrow::Cow; use std::ops::Range; @@ -34,7 +35,11 @@ impl Plugin for CorePlugin { .unwrap_or_default() .create_default_pools(); - app.register_type::().register_type::(); + app.register_type::() + .register_type::() + .register_type::>() + .register_type_data::, ReflectSerialize>() + .register_type_data::, ReflectDeserialize>(); register_rust_types(app); register_math_types(app); diff --git a/crates/bevy_render/src/camera/mod.rs b/crates/bevy_render/src/camera/mod.rs index fbaed28a8f3aee..b96aeb9a5047b6 100644 --- a/crates/bevy_render/src/camera/mod.rs +++ b/crates/bevy_render/src/camera/mod.rs @@ -22,6 +22,7 @@ impl Plugin for CameraPlugin { fn build(&self, app: &mut App) { app.register_type::() .register_type::() + .register_type::>() .register_type::() .register_type::() .register_type::()