Last active
May 29, 2026 15:56
-
-
Save ForwardFeed/5071e628177bedee76867e3b2472b82c to your computer and use it in GitHub Desktop.
Bevy Snippets (VSCodium || VSCode)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "BevyPrelude": { | |
| "prefix": "BevyPrelude", | |
| "body": [ | |
| "use bevy::prelude::*;", | |
| "" | |
| ] | |
| }, | |
| "BevyPlugin": { | |
| "prefix": "BevyPlugin", | |
| "body": [ | |
| "pub struct $1;", | |
| "", | |
| "impl Plugin for $1 {", | |
| "\tfn build(&self, app: &mut App){", | |
| "\t\t", | |
| "\t}", | |
| "}" | |
| ] | |
| }, | |
| "BevyCommand": { | |
| "prefix": "mut commands", | |
| "body": "mut commands: Commands" | |
| }, | |
| "BevyComponent": { | |
| "prefix": "BevyComponent", | |
| "body": [ | |
| "#[derive(Component)]", | |
| "struct $1;", | |
| ] | |
| }, | |
| "BevyObserverFactory": { | |
| "prefix": "BevyObserverFactory", | |
| "body": [ | |
| "fn $1<E: EntityEvent>(", | |
| "\t", | |
| ")-> impl Fn(On<E>, Query<$2>>){", | |
| "\tmove |event, mut query|{", | |
| "\t\tif let Ok(mut stuff) = query.get_mut(event.event_target()){", | |
| "\t\t", | |
| "\t\t}", | |
| "\t}", | |
| "}" | |
| ] | |
| }, | |
| "BevyStates": { | |
| "prefix": "BevyStates", | |
| "body": [ | |
| "#[derive(Debug, Clone, Eq, PartialEq, Hash, Default, States)]", | |
| "enum $1 {", | |
| "\t#[default]", | |
| "\tClosed,", | |
| "\tOpen,", | |
| "}", | |
| ".init_state::<$1>()" | |
| ] | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment