bevy/crates/bevy_app/src/plugin.rs
EthanYidong 4c753e2588
move dynamic plugin loading to its own optional crate (#544)
move dynamic plugin loading to its own crate
2020-10-01 13:04:06 -07:00

15 lines
469 B
Rust

use crate::AppBuilder;
use std::any::Any;
/// A collection of Bevy App logic and configuration
///
/// Plugins use [AppBuilder] to configure an [App](crate::App). When an [App](crate::App) registers a plugin, the plugin's [Plugin::build] function is run.
pub trait Plugin: Any + Send + Sync {
fn build(&self, app: &mut AppBuilder);
fn name(&self) -> &str {
std::any::type_name::<Self>()
}
}
pub type CreatePlugin = unsafe fn() -> *mut dyn Plugin;