Blacksite/crates/editor/src/infra.rs
Rbanh f29712d158
Some checks are pending
CI / Format, lint, test, build (push) Waiting to run
Initial project import
2026-06-05 21:44:45 -04:00

26 lines
688 B
Rust

use bevy::picking::Pickable;
use bevy::prelude::*;
/// Marker for editor/runtime helper entities that are never authored content.
#[derive(Component, Reflect, Default, Debug, Clone, Copy)]
#[reflect(Component, Default, Debug)]
pub struct EditorOnly;
pub struct EditorInfraPlugin;
impl Plugin for EditorInfraPlugin {
fn build(&self, app: &mut App) {
app.register_type::<EditorOnly>()
.add_systems(Update, make_editor_only_non_pickable);
}
}
fn make_editor_only_non_pickable(
mut commands: Commands,
editor_only: Query<Entity, Added<EditorOnly>>,
) {
for entity in &editor_only {
commands.entity(entity).insert(Pickable::IGNORE);
}
}