pub trait FnPluginsExt {
    // Required method
    fn fn_plugins<T>(&mut self, f: impl FnPlugins<T>) -> &mut Self;
}

Required Methods§

source

fn fn_plugins<T>(&mut self, f: impl FnPlugins<T>) -> &mut Self

Extended App method that adds functions as plugins to the main bevy app. Useful for creating plugin hierarchies (struct Plugins as base plugins and fn plugins as sub-plugins). This method is heavily inspired by bevy’s App::add_plugins method.

use bevy::prelude::*;

fn main() {
    App::new().fn_plugins(example_plugin).run();
}

fn example_plugin(app: &mut App) {
    println!("Hello from example_plugin!");
}

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FnPluginsExt for App

source§

fn fn_plugins<T>(&mut self, f: impl FnPlugins<T>) -> &mut Self

Implementors§