-
Notifications
You must be signed in to change notification settings - Fork 0
/
the-way-snippets.json
2 lines (2 loc) · 1.09 KB
/
the-way-snippets.json
1
2
{"index":1,"description":"main function","language":"rust","code":"fn main() -> Result<Box<dyn std::error::Error>> {\n\n Ok(())\n}","extension":".rs","tags":["main"],"date":"2024-04-11T00:00:00Z","updated":"2024-04-11T21:11:12.076528310Z"}
{"index":2,"description":"default bevy main function","language":"rust","code":"use bevy::{app::AppExit, input::common_conditions::*, prelude::*};\nuse bevy_egui::{EguiContexts, EguiPlugin};\n\nconst NAME: &str = env!(\"CARGO_PKG_NAME\");\n\n// bevy v0.13.0\nfn main() -> Result<(), Box<dyn std::error::Error>> {\n App::new()\n .add_plugins(DefaultPlugins)\n // .add_plugins(EguiPlugin)\n .add_systems(\n Update,\n quit_application.run_if(input_just_pressed(KeyCode::KeyQ)),\n )\n .run();\n\n Ok(())\n}\n\n/// Quit the running bevy application\nfn quit_application(mut app_exit_event: EventWriter<AppExit>) {\n info!(\"quitting application\");\n app_exit_event.send(AppExit);\n}","extension":".rs","tags":["bevy","egui","main"],"date":"2024-04-11T00:00:00Z","updated":"2024-04-11T21:10:50.860635329Z"}