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