pub trait Plugin:
Send
+ Sync
+ 'static {
// Required method
fn build(&self, app: &mut App);
// Provided methods
fn name(&self) -> &'static str { ... }
fn dependencies(&self) -> Vec<TypeId> { ... }
}Expand description
A modular unit of app configuration.
Plugins add systems, resources, and other configuration to an App.
They enable reusable, composable game engine features.
§Example
ⓘ
use goud_engine::ecs::app::{App, Plugin};
struct PhysicsPlugin;
impl Plugin for PhysicsPlugin {
fn build(&self, app: &mut App) {
// Add physics systems, resources, etc.
}
}Required Methods§
Provided Methods§
Sourcefn dependencies(&self) -> Vec<TypeId>
fn dependencies(&self) -> Vec<TypeId>
Returns the TypeIds of plugins this plugin depends on.
Dependencies must be added before this plugin. The default implementation returns an empty list (no dependencies).