Skip to content

Commit

Permalink
Add .vscode/bevy.code-snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Jul 21, 2024
1 parent d605473 commit 3bb0861
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .vscode/bevy.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"Plugin": {
"scope": "rust",
"prefix": "plugin",
"body": [
"use bevy::prelude::*;",
"",
"use crate::util::prelude::*;",
"",
"pub(super) fn plugin(app: &mut App) {",
" $0",
"}"
],
"description": "Define a top-level plugin"
},
"Component": {
"scope": "rust",
"prefix": "component",
"body": [
"#[derive(Component, Reflect)]",
"#[reflect(Component)]",
"pub struct $1;$0",
"",
"impl Configure for $1 {",
" fn configure(app: &mut App) {",
" app.register_type::<Self>();",
" }",
"}"
],
"description": "Define a Component"
},
"Resource": {
"scope": "rust",
"prefix": "resource",
"body": [
"#[derive(Resource, Reflect, Default)]",
"#[reflect(Resource)]",
"pub struct $1;$0",
"",
"impl Configure for $1 {",
" fn configure(app: &mut App) {",
" app.register_type::<Self>();",
" app.init_resource::<Self>();",
" }",
"}"
],
"description": "Define a Resource"
}
}

0 comments on commit 3bb0861

Please sign in to comment.