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
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
setupfunction of the plugins that have been registered in the App when using an external event loop to drive a bevy App.bevy/crates/bevy_app/src/app.rs
Lines 295 to 300 in 1ffeff1
What solution would you like?
Make
plugin_registrypublic?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