bevy/crates/bevy_asset/src
Robert Swain e928acb9ff bevy_asset: Add AssetServerSettings watch_for_changes member (#3643)
# 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()`
2022-02-04 03:21:29 +00:00
..
diagnostic Down with the system! (#2496) 2021-07-27 23:42:36 +00:00
io bevy_asset: Add AssetServerSettings watch_for_changes member (#3643) 2022-02-04 03:21:29 +00:00
asset_server.rs bevy_asset: Add AssetServerSettings watch_for_changes member (#3643) 2022-02-04 03:21:29 +00:00
assets.rs Enable the doc_markdown clippy lint (#3457) 2022-01-09 23:20:13 +00:00
filesystem_watcher.rs Bump notify to 5.0.0-pre.11 (#2564) 2021-07-29 23:56:16 +00:00
handle.rs Documented Handles and Assets (#3348) 2022-01-04 23:38:39 +00:00
info.rs [assets] set LoadState properly and more testing! (#2226) 2021-06-08 02:46:44 +00:00
lib.rs bevy_asset: Add AssetServerSettings watch_for_changes member (#3643) 2022-02-04 03:21:29 +00:00
loader.rs Fix doc_markdown lints in bevy_asset (#3468) 2021-12-29 17:52:39 +00:00
path.rs Allow String and &String as Id for AssetServer.get_handle(id) (#3280) 2021-12-09 22:40:15 +00:00