remove ui camera now that default 2d camera is identical

This commit is contained in:
Carter Anderson 2020-06-27 10:20:26 -07:00
parent e75496772e
commit 981687ae41
5 changed files with 4 additions and 25 deletions

View File

@ -1,6 +1,6 @@
use crate::{
base_render_graph, draw::Draw, mesh::Mesh, pipeline::RenderPipelines, Camera,
OrthographicProjection, PerspectiveProjection, WindowOrigin, VisibleEntities,
OrthographicProjection, PerspectiveProjection, VisibleEntities,
};
use bevy_asset::Handle;
use bevy_derive::ComponentSet;
@ -57,26 +57,6 @@ pub struct OrthographicCameraComponents {
pub scale: Scale,
}
impl OrthographicCameraComponents {
pub fn ui() -> Self {
OrthographicCameraComponents {
camera: Camera {
name: Some("UiCamera".to_string()),
..Default::default()
},
orthographic_projection: OrthographicProjection {
window_origin: WindowOrigin::Center,
..Default::default()
},
visible_entities: Default::default(),
transform: Default::default(),
translation: Default::default(),
rotation: Default::default(),
scale: Default::default(),
}
}
}
impl Default for OrthographicCameraComponents {
fn default() -> Self {
OrthographicCameraComponents {

View File

@ -69,7 +69,6 @@ fn setup(
.build()
// 2d camera
.entity_with(OrthographicCameraComponents::default())
.entity_with(OrthographicCameraComponents::ui())
// texture
.entity_with(LabelComponents {
node: Node::new(

View File

@ -25,7 +25,7 @@ fn setup(asset_server: Res<AssetServer>, command_buffer: &mut CommandBuffer) {
command_buffer
.build()
// 2d camera
.entity_with(OrthographicCameraComponents::ui())
.entity_with(OrthographicCameraComponents::default())
// texture
.entity_with(LabelComponents {
node: Node::new(

View File

@ -56,7 +56,7 @@ fn setup(
// ..Default::default()
// })
// ui camera
.entity_with(OrthographicCameraComponents::ui())
.entity_with(OrthographicCameraComponents::default())
// root node
.entity_with(UiComponents {
node: Node::new(Anchors::FULL, Margins::default()),

View File

@ -23,7 +23,7 @@ fn placement_system(
fn setup(mut materials: ResMut<Assets<ColorMaterial>>, command_buffer: &mut CommandBuffer) {
let mut builder = command_buffer.build();
builder.entity_with(OrthographicCameraComponents::ui());
builder.entity_with(OrthographicCameraComponents::default());
let mut prev = Vec2::default();
let count = 1000;