bevy-butler

Crates.iobevy-butler
lib.rsbevy-butler
version
sourcesrc
created_at2025-01-07 07:54:15.191054
updated_at2025-01-08 22:31:15.740052
descriptionA crate for making Bevy systems more self-documenting
homepage
repositoryhttps://github.com/TGRCdev/bevy-butler
max_upload_size
id1506857
Cargo.toml error:TOML parse error at line 23, column 1 | 23 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
TGRCDev (TGRCdev)

documentation

README

bevy-butler

A crate for making Bevy systems more self-documenting.

Crates.io License Crates.io Version docs.rs

Note: This crate uses nightly features, and thus requires a nightly compiler.

use bevy::prelude::*;
use bevy_butler::*;

#[system(schedule = Startup)]
fn hello_world()
{
    info!("Hello, world!");
}

#[derive(Resource)]
pub struct Hello(pub String);

pub struct MyPlugin;

#[butler_plugin]
impl Plugin for MyPlugin {
    fn build(&self, app: &mut App) {
        app.insert_resource(Hello("MyPlugin".to_string()));
    }
}

#[system(schedule = Update, plugin = MyPlugin)]
fn hello_plugin(name: Res<Hello>)
{
    info!("Hello, {}!", name.0);
}

#[system(schedule = Update, plugin = MyPlugin, after = hello_plugin)]
fn goodbye_plugin(name: Res<Hello>)
{
    info!("Goodbye, {}!", name.0);
}

fn main() {
    App::new()
        .add_plugins((BevyButlerPlugin, MyPlugin))
        .run();
}
Commit count: 30

cargo fmt