bevy
bevy copied to clipboard
Remove `AssetServer::watch_for_changes()`
Objective
AssetServer::watch_for_changes()
is racy and redundant with AssetServerSettings
.
Closes #5964.
Changelog
- Remove
AssetServer::watch_for_changes()
- Add
AssetServerSettings
to the prelude. - Minor cleanup.
Migration Guide
AssetServer::watch_for_changes()
was removed.
Instead, use the AssetServerSettings
resource.
app // AssetServerSettings must be inserted before adding the AssetPlugin or DefaultPlugins.
.insert_resource(AssetServerSettings {
watch_for_changes: true,
..default()
})
could we have a method so that enabling hot reloading doesn't require 4 lines of boilerplate?
It's tempting to add a method like that, but then it becomes awkward when trying to set other settings, requiring a refactor.
Maybe consider deprecating?
Francois argues that we should just break things. It makes sense to me to avoid the maintenance cost of deprecation :)
bors r+
Pull request successfully merged into main.
Build succeeded: