setup_primary_egui_context_system

Function setup_primary_egui_context_system 

Source
pub fn setup_primary_egui_context_system(
    commands: Commands<'_, '_>,
    new_cameras: Query<'_, '_, (Entity, Option<&EguiContext>), Added<Camera>>,
    enable_multipass_for_primary_context: Option<Res<'_, EnableMultipassForPrimaryContext>>,
    egui_context_exists: Local<'_, bool>,
) -> Result
Expand description

Adds bevy_egui components to a first found camera assuming it’s a primary one.

To disable this behavior, set EguiGlobalSettings::auto_create_primary_context to false before you create your first camera. When spawning a camera to which you want to attach the primary Egui context, insert the EguiPrimaryContextPass component into the respective camera entity.