fix the testcases
This commit is contained in:
parent
9a551573cb
commit
8fb0022280
@ -1,6 +1,8 @@
|
|||||||
use bevy::{app::AppExit, prelude::*};
|
use bevy::{app::AppExit, prelude::*};
|
||||||
use bevy_egui::{egui, EguiContexts, EguiPlugin};
|
use bevy_egui::{egui, EguiContexts, EguiPlugin};
|
||||||
use bevy_prototype_lyon::prelude::{Fill, GeometryBuilder, Path, PathBuilder, ShapePlugin, Stroke};
|
use bevy_prototype_lyon::prelude::{
|
||||||
|
Fill, GeometryBuilder, Path, PathBuilder, ShapeBundle, ShapePlugin, Stroke,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Default, Resource)]
|
#[derive(Default, Resource)]
|
||||||
struct OccupiedScreenSpace {
|
struct OccupiedScreenSpace {
|
||||||
@ -31,12 +33,12 @@ fn main() {
|
|||||||
}),
|
}),
|
||||||
..default()
|
..default()
|
||||||
}))
|
}))
|
||||||
.add_plugin(EguiPlugin)
|
.add_plugins(EguiPlugin)
|
||||||
.add_plugin(ShapePlugin)
|
.add_plugins(ShapePlugin)
|
||||||
.init_resource::<OccupiedScreenSpace>()
|
.init_resource::<OccupiedScreenSpace>()
|
||||||
.add_startup_system(setup_system)
|
.add_systems(Startup, setup_system)
|
||||||
.add_system(ui)
|
.add_systems(Update, ui)
|
||||||
.add_system(update_path)
|
.add_systems(Update, update_path)
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,5 +101,12 @@ fn setup_system(mut commands: Commands) {
|
|||||||
let fill = Fill::color(Color::MIDNIGHT_BLUE);
|
let fill = Fill::color(Color::MIDNIGHT_BLUE);
|
||||||
let stroke = Stroke::color(Color::BLACK);
|
let stroke = Stroke::color(Color::BLACK);
|
||||||
|
|
||||||
commands.spawn((GeometryBuilder::build_as(&line), fill, stroke));
|
commands.spawn((
|
||||||
|
ShapeBundle {
|
||||||
|
path: GeometryBuilder::build_as(&line),
|
||||||
|
..default()
|
||||||
|
},
|
||||||
|
fill,
|
||||||
|
stroke,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,10 @@ fn main() {
|
|||||||
App::new()
|
App::new()
|
||||||
.insert_resource(Msaa::Sample4)
|
.insert_resource(Msaa::Sample4)
|
||||||
.add_plugins(DefaultPlugins)
|
.add_plugins(DefaultPlugins)
|
||||||
.add_plugin(ShapePlugin)
|
.add_plugins(ShapePlugin)
|
||||||
.add_plugin(TweeningPlugin)
|
.add_plugins(TweeningPlugin)
|
||||||
.add_startup_system(setup_system)
|
.add_systems(Startup, setup_system)
|
||||||
.add_system(component_animator_system::<Path>)
|
.add_systems(Update, component_animator_system::<Path>)
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,14 @@ fn setup_system(mut commands: Commands) {
|
|||||||
let fill = Fill::color(Color::MIDNIGHT_BLUE);
|
let fill = Fill::color(Color::MIDNIGHT_BLUE);
|
||||||
let stroke = Stroke::color(Color::BLACK);
|
let stroke = Stroke::color(Color::BLACK);
|
||||||
commands
|
commands
|
||||||
.spawn((GeometryBuilder::build_as(&line), fill, stroke))
|
.spawn((
|
||||||
|
ShapeBundle {
|
||||||
|
path: GeometryBuilder::build_as(&line),
|
||||||
|
..default()
|
||||||
|
},
|
||||||
|
fill,
|
||||||
|
stroke,
|
||||||
|
))
|
||||||
.insert(animator);
|
.insert(animator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user