mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
329b71fa62
# Objective - Fixes #7081. ## Solution - Moved functionality from kitchen sink plugin `CorePlugin` to separate plugins, `TaskPoolPlugin`, `TypeRegistrationPlugin`, `FrameCountPlugin`. `TaskPoolOptions` resource should now be used with `TaskPoolPlugin`. ## Changelog Minimal changes made (code kept in `bevy_core/lib.rs`). ## Migration Guide - `CorePlugin` broken into separate plugins. If not using `DefaultPlugins` or `MinimalPlugins` `PluginGroup`s, the replacement for `CorePlugin` is now to add `TaskPoolPlugin`, `TypeRegistrationPlugin`, and `FrameCountPlugin` to the app. ## Notes - Consistent with Bevy goal "modularity over deep integration" but the functionality of `TypeRegistrationPlugin` and `FrameCountPlugin` is weak (the code has to go somewhere, though!). - No additional tests written.
12 lines
337 B
Rust
12 lines
337 B
Rust
//! This example illustrates how to customize the thread pool used internally (e.g. to only use a
|
|
//! certain number of threads).
|
|
|
|
use bevy::prelude::*;
|
|
|
|
fn main() {
|
|
App::new()
|
|
.add_plugins(DefaultPlugins.set(TaskPoolPlugin {
|
|
task_pool_options: TaskPoolOptions::with_num_threads(4),
|
|
}))
|
|
.run();
|
|
}
|