bevy/examples/asset
Carter Anderson 6f27e0e35f
Add asset_processor feature and remove AssetMode::ProcessedDev (#10194)
# Objective

Users shouldn't need to change their source code between "development
workflows" and "releasing". Currently, Bevy Asset V2 has two "processed"
asset modes `Processed` (assumes assets are already processed) and
`ProcessedDev` (starts an asset processor and processes assets). This
means that the mode must be changed _in code_ when switching from "app
dev" to "release". Very suboptimal.

We have already removed "runtime opt-in" for hot-reloading. Enabling the
`file_watcher` feature _automatically_ enables file watching in code.
This means deploying a game (without hot reloading enabled) just means
calling `cargo build --release` instead of `cargo run --features
bevy/file_watcher`.

We should adopt this pattern for asset processing.

## Solution

This adds the `asset_processor` feature, which will start the
`AssetProcessor` when an `AssetPlugin` runs in `AssetMode::Processed`.

The "asset processing workflow" is now:
1. Enable `AssetMode::Processed` on `AssetPlugin`
2. When developing, run with the `asset_processor` and `file_watcher`
features
3. When releasing, build without these features.

The `AssetMode::ProcessedDev` mode has been removed.
2023-10-20 20:50:26 +00:00
..
processing Add asset_processor feature and remove AssetMode::ProcessedDev (#10194) 2023-10-20 20:50:26 +00:00
asset_loading.rs Remove monkey.gltf (#9974) 2023-09-30 02:50:31 +00:00
custom_asset.rs Removed anyhow (#10003) 2023-10-06 07:20:13 +00:00
custom_asset_reader.rs Multiple Asset Sources (#9885) 2023-10-13 23:17:32 +00:00
hot_asset_reloading.rs Multiple Asset Sources (#9885) 2023-10-13 23:17:32 +00:00