Skip to content

Reduce boilerplate for bevy plugins

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

af-games/af_bevy_plugin_macro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AF Bevy Plugin Macro

What?

Automates generation of bevy plugins boilerplate.

Usage

Let's say you have a Bevy crate called Foo consisting of two plugins, ControlPlugin and DisplayPlugin. You might write a lib.rs like this:

use bevy::prelude::*;
pub mod control;
pub use control::*;
pub mod display;
pub use display::*;

pub struct FooPlugins;
use bevy::{app::PluginGroupBuilder, app::PluginGroup};
impl PluginGroup for FooPlugins {
    fn build(self) -> PluginGroupBuilder {
        PluginGroupBuilder::start::<Self>()
                .add(control::ControlPlugin)
                .add(display::DisplayPlugin)
    }
}

Replace this with:

use bevy::prelude::*;
use af_bevy_plugin_macro::bevy_plugin_group;

bevy_plugin_group!(foo, control, display);

Much better!

License

AF Bevy Plugin Macro is free, open source and permissively licensed!

All code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.

About

Reduce boilerplate for bevy plugins

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages