mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 14:40:19 +00:00
e928acb9ff
# Objective - `asset_server.watch_for_changes().unwrap()` only watches changes for assets loaded **_after_** that call. - Technically, the `hot_asset_reloading` example is racey as the watch on the asset path is set up in an async task scheduled from the asset `load()`, but the filesystem watcher is only constructed in a call that comes **_after_** the call to `load()`. ## Solution - It feels safest to allow enabling watching the filesystem for changes on the asset server from the point of its construction. Therefore, adding such an option to `AssetServerSettings` seemed to be the correct solution. - Fix `hot_asset_reloading` by inserting the `AssetServerSettings` resource with `watch_for_changes: true` instead of calling `asset_server.watch_for_changes().unwrap()`. - Document the shortcomings of `.watch_for_changes()` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |