chore(examples): fixed camera ordering issue when used with bevy_editor_pls

This commit is contained in:
kaosat.dev 2024-03-04 10:45:58 +01:00
parent b73ecbabed
commit a80bb1e9a1
7 changed files with 60 additions and 11 deletions

View File

@ -2,7 +2,14 @@ use bevy::prelude::*;
use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu};
pub fn setup_main_menu(mut commands: Commands) { pub fn setup_main_menu(mut commands: Commands) {
commands.spawn((Camera2dBundle::default(), InMainMenu)); commands.spawn((
Camera2dBundle{
camera: Camera {
order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28
..default()
},
..Default::default()
}, InMainMenu));
commands.spawn(( commands.spawn((
TextBundle::from_section( TextBundle::from_section(

View File

@ -2,7 +2,14 @@ use bevy::prelude::*;
use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu};
pub fn setup_main_menu(mut commands: Commands) { pub fn setup_main_menu(mut commands: Commands) {
commands.spawn((Camera2dBundle::default(), InMainMenu)); commands.spawn((
Camera2dBundle{
camera: Camera {
order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28
..default()
},
..Default::default()
}, InMainMenu));
commands.spawn(( commands.spawn((
TextBundle::from_section( TextBundle::from_section(

View File

@ -2,7 +2,14 @@ use bevy::prelude::*;
use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu};
pub fn setup_main_menu(mut commands: Commands) { pub fn setup_main_menu(mut commands: Commands) {
commands.spawn((Camera2dBundle::default(), InMainMenu)); commands.spawn((
Camera2dBundle{
camera: Camera {
order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28
..default()
},
..Default::default()
}, InMainMenu));
commands.spawn(( commands.spawn((
TextBundle::from_section( TextBundle::from_section(

View File

@ -2,7 +2,14 @@ use bevy::prelude::*;
use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu};
pub fn setup_main_menu(mut commands: Commands) { pub fn setup_main_menu(mut commands: Commands) {
commands.spawn((Camera2dBundle::default(), InMainMenu)); commands.spawn((
Camera2dBundle{
camera: Camera {
order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28
..default()
},
..Default::default()
}, InMainMenu));
commands.spawn(( commands.spawn((
TextBundle::from_section( TextBundle::from_section(

View File

@ -2,7 +2,14 @@ use bevy::prelude::*;
use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu};
pub fn setup_main_menu(mut commands: Commands) { pub fn setup_main_menu(mut commands: Commands) {
commands.spawn((Camera2dBundle::default(), InMainMenu)); commands.spawn((
Camera2dBundle{
camera: Camera {
order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28
..default()
},
..Default::default()
}, InMainMenu));
commands.spawn(( commands.spawn((
TextBundle::from_section( TextBundle::from_section(

View File

@ -2,7 +2,14 @@ use bevy::prelude::*;
use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu};
pub fn setup_main_menu(mut commands: Commands) { pub fn setup_main_menu(mut commands: Commands) {
commands.spawn((Camera2dBundle::default(), InMainMenu)); commands.spawn((
Camera2dBundle{
camera: Camera {
order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28
..default()
},
..Default::default()
}, InMainMenu));
commands.spawn(( commands.spawn((
TextBundle::from_section( TextBundle::from_section(

View File

@ -2,7 +2,14 @@ use bevy::prelude::*;
use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu}; use bevy_gltf_worlflow_examples_common::{AppState, InMainMenu};
pub fn setup_main_menu(mut commands: Commands) { pub fn setup_main_menu(mut commands: Commands) {
commands.spawn((Camera2dBundle::default(), InMainMenu)); commands.spawn((
Camera2dBundle{
camera: Camera {
order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28
..default()
},
..Default::default()
}, InMainMenu));
commands.spawn(( commands.spawn((
TextBundle::from_section( TextBundle::from_section(