cyber_rider/src/glamor.rs

31 lines
839 B
Rust
Raw Normal View History

2022-01-14 06:05:51 +00:00
use bevy::{
pbr::wireframe::{Wireframe, WireframeConfig, WireframePlugin},
prelude::*,
render::{options::WgpuOptions, render_resource::WgpuFeatures},
};
use crate::geometry::CyberSphere;
fn wireframe(
mut commands: Commands,
mut wireframe_config: ResMut<WireframeConfig>,
query: Query<Entity, With<CyberSphere>>,
) {
let ent = query.single();
wireframe_config.global = false;
commands.entity(ent).insert(Wireframe);
}
// public plugin
pub struct CyberGlamorPlugin;
impl Plugin for CyberGlamorPlugin {
fn build(&self, app: &mut App) {
app.insert_resource(WgpuOptions {
features: WgpuFeatures::POLYGON_MODE_LINE,
..Default::default()
})
.add_startup_system_to_stage(StartupStage::PostStartup, wireframe)
.add_plugin(WireframePlugin);
}
}