Crates.io | bevy-butler |
lib.rs | bevy-butler |
version | |
source | src |
created_at | 2025-01-07 07:54:15.191054 |
updated_at | 2025-01-08 22:31:15.740052 |
description | A crate for making Bevy systems more self-documenting |
homepage | |
repository | https://github.com/TGRCdev/bevy-butler |
max_upload_size | |
id | 1506857 |
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` |
size | 0 |
A crate for making Bevy systems more self-documenting.
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();
}