remove ui camera now that default 2d camera is identical
This commit is contained in:
parent
e75496772e
commit
981687ae41
@ -1,6 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
base_render_graph, draw::Draw, mesh::Mesh, pipeline::RenderPipelines, Camera,
|
base_render_graph, draw::Draw, mesh::Mesh, pipeline::RenderPipelines, Camera,
|
||||||
OrthographicProjection, PerspectiveProjection, WindowOrigin, VisibleEntities,
|
OrthographicProjection, PerspectiveProjection, VisibleEntities,
|
||||||
};
|
};
|
||||||
use bevy_asset::Handle;
|
use bevy_asset::Handle;
|
||||||
use bevy_derive::ComponentSet;
|
use bevy_derive::ComponentSet;
|
||||||
@ -57,26 +57,6 @@ pub struct OrthographicCameraComponents {
|
|||||||
pub scale: Scale,
|
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 {
|
impl Default for OrthographicCameraComponents {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
OrthographicCameraComponents {
|
OrthographicCameraComponents {
|
||||||
|
@ -69,7 +69,6 @@ fn setup(
|
|||||||
.build()
|
.build()
|
||||||
// 2d camera
|
// 2d camera
|
||||||
.entity_with(OrthographicCameraComponents::default())
|
.entity_with(OrthographicCameraComponents::default())
|
||||||
.entity_with(OrthographicCameraComponents::ui())
|
|
||||||
// texture
|
// texture
|
||||||
.entity_with(LabelComponents {
|
.entity_with(LabelComponents {
|
||||||
node: Node::new(
|
node: Node::new(
|
||||||
|
@ -25,7 +25,7 @@ fn setup(asset_server: Res<AssetServer>, command_buffer: &mut CommandBuffer) {
|
|||||||
command_buffer
|
command_buffer
|
||||||
.build()
|
.build()
|
||||||
// 2d camera
|
// 2d camera
|
||||||
.entity_with(OrthographicCameraComponents::ui())
|
.entity_with(OrthographicCameraComponents::default())
|
||||||
// texture
|
// texture
|
||||||
.entity_with(LabelComponents {
|
.entity_with(LabelComponents {
|
||||||
node: Node::new(
|
node: Node::new(
|
||||||
|
@ -56,7 +56,7 @@ fn setup(
|
|||||||
// ..Default::default()
|
// ..Default::default()
|
||||||
// })
|
// })
|
||||||
// ui camera
|
// ui camera
|
||||||
.entity_with(OrthographicCameraComponents::ui())
|
.entity_with(OrthographicCameraComponents::default())
|
||||||
// root node
|
// root node
|
||||||
.entity_with(UiComponents {
|
.entity_with(UiComponents {
|
||||||
node: Node::new(Anchors::FULL, Margins::default()),
|
node: Node::new(Anchors::FULL, Margins::default()),
|
||||||
|
@ -23,7 +23,7 @@ fn placement_system(
|
|||||||
|
|
||||||
fn setup(mut materials: ResMut<Assets<ColorMaterial>>, command_buffer: &mut CommandBuffer) {
|
fn setup(mut materials: ResMut<Assets<ColorMaterial>>, command_buffer: &mut CommandBuffer) {
|
||||||
let mut builder = command_buffer.build();
|
let mut builder = command_buffer.build();
|
||||||
builder.entity_with(OrthographicCameraComponents::ui());
|
builder.entity_with(OrthographicCameraComponents::default());
|
||||||
|
|
||||||
let mut prev = Vec2::default();
|
let mut prev = Vec2::default();
|
||||||
let count = 1000;
|
let count = 1000;
|
||||||
|
Loading…
Reference in New Issue
Block a user