Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.29 KB

README.md

File metadata and controls

48 lines (37 loc) · 1.29 KB

bevy-butler

A set of procedural macros for making Bevy plugins and systems more self-documenting.

Crates.io License Crates.io Version docs.rs Crates.io MSRV

Version Compatibility

bevy bevy-butler
0.15 0.5

Example

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

#[butler_plugin]
pub struct MyPlugin;

#[derive(Resource)]
#[resource(plugin = MyPlugin, init = Hello("World".to_string()))]
pub struct Hello(pub 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(MyPlugin)
        .run();
}

WebAssembly support

WebAssembly support is currently locked behind the wasm-experimental flag. See the relevant issue for more information.