File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ pub mod debug_plugin;
Original file line number Diff line number Diff line change 1+ use bevy:: prelude:: * ;
2+
3+ ///This plugin provides terminal debug capabilities
4+ ///By adding systems, requested information will be printed to the terminal
5+ pub struct DebugPlugin ;
6+
7+ ///add the system(s) you wish to use to have debug info printed to terminal
8+ impl Plugin for DebugPlugin {
9+ fn build ( & self , app : & mut App ) {
10+ app. add_systems ( Startup , print_debug_active_message) ;
11+ }
12+ }
13+
14+ ///Function that verifies that the debugger is active by printing a single message to the terminal on startup
15+ ///To use, add system using add_systems
16+ fn print_debug_active_message ( ) {
17+ info ! ( "The debugger is active!" ) ;
18+ }
Original file line number Diff line number Diff line change 1+ mod debug;
12mod movement;
23
34use avian2d:: prelude:: * ;
45use bevy:: prelude:: * ;
56use bevy_ecs_ldtk:: prelude:: * ;
7+ use debug:: debug_plugin:: DebugPlugin ;
68use movement:: plugin:: CharacterControllerPlugin ;
79
810fn main ( ) {
@@ -11,5 +13,7 @@ fn main() {
1113 . add_plugins ( PhysicsPlugins :: default ( ) )
1214 . add_plugins ( LdtkPlugin )
1315 . add_plugins ( CharacterControllerPlugin )
16+ //user plugins
17+ . add_plugins ( DebugPlugin )
1418 . run ( ) ;
1519}
You can’t perform that action at this time.
0 commit comments