Derive Reflect for Exposure (#11907)

# Objective

- Don't crash when loading a scene with a camera

## Solution

- Derive Reflect for Exposure

Closes https://github.com/bevyengine/bevy/issues/11905
This commit is contained in:
IceSentry 2024-02-16 14:03:46 -05:00 committed by GitHub
parent 80f2ee2910
commit f81aa64ca4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,8 @@ pub struct ComputedCameraValues {
/// How much energy a `Camera3d` absorbs from incoming light. /// How much energy a `Camera3d` absorbs from incoming light.
/// ///
/// <https://en.wikipedia.org/wiki/Exposure_(photography)> /// <https://en.wikipedia.org/wiki/Exposure_(photography)>
#[derive(Component)] #[derive(Component, Clone, Copy, Reflect)]
#[reflect_value(Component)]
pub struct Exposure { pub struct Exposure {
/// <https://en.wikipedia.org/wiki/Exposure_value#Tabulated_exposure_values> /// <https://en.wikipedia.org/wiki/Exposure_value#Tabulated_exposure_values>
pub ev100: f32, pub ev100: f32,

View File

@ -32,6 +32,7 @@ impl Plugin for CameraPlugin {
.register_type::<ClearColorConfig>() .register_type::<ClearColorConfig>()
.register_type::<CameraRenderGraph>() .register_type::<CameraRenderGraph>()
.register_type::<CameraMainTextureUsages>() .register_type::<CameraMainTextureUsages>()
.register_type::<Exposure>()
.init_resource::<ManualTextureViews>() .init_resource::<ManualTextureViews>()
.init_resource::<ClearColor>() .init_resource::<ClearColor>()
.add_plugins(( .add_plugins((