Skip to content

Need a way to call the setup() of the plugins that have been registered in the App manually #7576

Description

@jinleili

What problem does this solve or what need does it fill?

Due to changes in #7046, it is now necessary to have a way to call the setup function of the plugins that have been registered in the App when using an external event loop to drive a bevy App.

// temporarily remove the plugin registry to run each plugin's setup function on app.
let mut plugin_registry = std::mem::take(&mut app.plugin_registry);
for plugin in &plugin_registry {
plugin.setup(&mut app);
}
std::mem::swap(&mut app.plugin_registry, &mut plugin_registry);

What solution would you like?

Make plugin_registry public?

What alternative(s) have you considered?

Move relevant code above into a separate pub fn?

Additional context

External event loop demo: https://github.com/jinleili/bevy-in-app

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AppBevy apps and pluginsC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions