Unignore Camera.target field for reflection (#14367)

# Objective

- The `RenderTarget` type wasn't being registered, and the `target`
field of `Camera` was marked as ignored, so it wasn't inspectable by
editors.

## Solution

- Remove `#[reflect(ignore)]` from the field
- I've also reordered the `Default` impl of `RenderTarget` because it
looked like it belonged to a different type
This commit is contained in:
Sludge 2024-07-22 20:46:40 +02:00 committed by GitHub
parent e06f4d4083
commit 4ea8c66321
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -211,7 +211,6 @@ pub struct Camera {
#[reflect(ignore)]
pub computed: ComputedCameraValues,
/// The "target" that this camera will render to.
#[reflect(ignore)]
pub target: RenderTarget,
/// If this is set to `true`, the camera will use an intermediate "high dynamic range" render texture.
/// This allows rendering with a wider range of lighting values.
@ -541,6 +540,12 @@ pub enum RenderTarget {
TextureView(ManualTextureViewHandle),
}
impl Default for RenderTarget {
fn default() -> Self {
Self::Window(Default::default())
}
}
impl From<Handle<Image>> for RenderTarget {
fn from(handle: Handle<Image>) -> Self {
Self::Image(handle)
@ -561,12 +566,6 @@ pub enum NormalizedRenderTarget {
TextureView(ManualTextureViewHandle),
}
impl Default for RenderTarget {
fn default() -> Self {
Self::Window(Default::default())
}
}
impl RenderTarget {
/// Normalize the render target down to a more concrete value, mostly used for equality comparisons.
pub fn normalize(&self, primary_window: Option<Entity>) -> Option<NormalizedRenderTarget> {