mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Assets: fix first hot reloading (#9804)
# Objective - Hot reloading doesn't work the first time it is used ## Solution - Currently, Bevy processor: 1. Create the `imported_assets` folder 2. Setup a watcher on it 3. Clear empty folders, so the `imported_assets` folder is deleted 4. Recreate the `imported_assets` folder and add all the imported assets - On a first run without an existing `imported_assets` with some content, hot reloading won't work as step 3 breaks the file watcher - This PR stops the empty root folder from being deleted - Also don't setup the processor internal asset server for file watching, freeing up a thread --------- Co-authored-by: Carter Anderson <mcanders1@gmail.com>
This commit is contained in:
parent
c81e2bd586
commit
e5b3cc45ba
1 changed files with 1 additions and 1 deletions
|
@ -506,7 +506,7 @@ impl AssetProcessor {
|
|||
.await?
|
||||
&& contains_files;
|
||||
}
|
||||
if !contains_files {
|
||||
if !contains_files && path.parent().is_some() {
|
||||
if let Some(writer) = clean_empty_folders_writer {
|
||||
// it is ok for this to fail as it is just a cleanup job.
|
||||
let _ = writer.remove_empty_directory(&path).await;
|
||||
|
|
Loading…
Reference in a new issue