Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Egui backend system ordering #217

Merged
merged 2 commits into from
Jun 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions backends/bevy_picking_egui/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//! A raycasting backend for [`bevy_egui`]
//! A raycasting backend for [`bevy_egui`]. This backend simply ensures that egui blocks other
//! entities from being picked.

#![allow(clippy::type_complexity)]
#![allow(clippy::too_many_arguments)]
#![deny(missing_docs)]

use bevy::{prelude::*, render::camera::NormalizedRenderTarget};
use bevy_egui::EguiContext;
use bevy_egui::{EguiContext, EguiSet};
use bevy_picking_core::backend::prelude::*;

/// Commonly used imports for the [`bevy_picking_egui`](crate) crate.
Expand All @@ -20,8 +21,12 @@ pub struct EguiBackend;
impl PickingBackend for EguiBackend {}
impl Plugin for EguiBackend {
fn build(&self, app: &mut App) {
app.add_system(egui_picking.in_set(PickSet::Backend))
.insert_resource(EguiBackendSettings::default());
app.add_system(
egui_picking
.in_set(PickSet::Backend)
.after(EguiSet::BeginFrame),
)
.insert_resource(EguiBackendSettings::default());

#[cfg(feature = "selection")]
app.add_system(update_settings.in_base_set(CoreSet::First));
Expand Down