mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Implement Reflect on NoFrustumCulling (#8801)
# Objective `NoFrustumCulling` doesn't implement `Reflect`, while nothing prevents it from implementing it. ## Solution Implement `Reflect` for it. --- ## Changelog - Add `Reflect` derive to `NoFrustrumCulling`. - Add `FromReflect` derive to `Visibility`.
This commit is contained in:
parent
a1494e53df
commit
c1fd505f9c
2 changed files with 6 additions and 6 deletions
|
@ -43,6 +43,7 @@ impl Plugin for ViewPlugin {
|
|||
app.register_type::<ComputedVisibility>()
|
||||
.register_type::<ComputedVisibilityFlags>()
|
||||
.register_type::<Msaa>()
|
||||
.register_type::<NoFrustumCulling>()
|
||||
.register_type::<RenderLayers>()
|
||||
.register_type::<Visibility>()
|
||||
.register_type::<VisibleEntities>()
|
||||
|
|
|
@ -6,10 +6,8 @@ use bevy_app::{Plugin, PostUpdate};
|
|||
use bevy_asset::{Assets, Handle};
|
||||
use bevy_ecs::prelude::*;
|
||||
use bevy_hierarchy::{Children, Parent};
|
||||
use bevy_reflect::Reflect;
|
||||
use bevy_reflect::{std_traits::ReflectDefault, FromReflect};
|
||||
use bevy_transform::components::GlobalTransform;
|
||||
use bevy_transform::TransformSystem;
|
||||
use bevy_reflect::{std_traits::ReflectDefault, FromReflect, Reflect, ReflectFromReflect};
|
||||
use bevy_transform::{components::GlobalTransform, TransformSystem};
|
||||
use std::cell::Cell;
|
||||
use thread_local::ThreadLocal;
|
||||
|
||||
|
@ -30,7 +28,7 @@ use crate::{
|
|||
/// This is done by the `visibility_propagate_system` which uses the entity hierarchy and
|
||||
/// `Visibility` to set the values of each entity's [`ComputedVisibility`] component.
|
||||
#[derive(Component, Clone, Copy, Reflect, FromReflect, Debug, PartialEq, Eq, Default)]
|
||||
#[reflect(Component, Default)]
|
||||
#[reflect(Component, Default, FromReflect)]
|
||||
pub enum Visibility {
|
||||
/// An entity with `Visibility::Inherited` will inherit the Visibility of its [`Parent`].
|
||||
///
|
||||
|
@ -157,7 +155,8 @@ pub struct VisibilityBundle {
|
|||
}
|
||||
|
||||
/// Use this component to opt-out of built-in frustum culling for Mesh entities
|
||||
#[derive(Component)]
|
||||
#[derive(Component, Default, Reflect, FromReflect)]
|
||||
#[reflect(Component, Default, FromReflect)]
|
||||
pub struct NoFrustumCulling;
|
||||
|
||||
/// Collection of entities visible from the current view.
|
||||
|
|
Loading…
Reference in a new issue