Skip to content

Commit 8fd6d09

Browse files
author
zhangyang
committed
资源路径的FileWatcher修复bug
1 parent cf90281 commit 8fd6d09

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

GameFramework/Editor/AssetManagement/AssetFileWatcher.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private static void RunAssetFileWatcher()
2121
{
2222
//Debug.Log($"AssetFileWatcher.RunAssetFileWatcher");
2323
_fileWatcher = new FileSystemWatcher();
24-
_fileWatcher.Path = Path.Combine(Application.dataPath, "Game");
24+
_fileWatcher.Path = Path.Combine(Application.dataPath);
2525
_fileWatcher.IncludeSubdirectories = true;
2626

2727
_fileWatcher.Created += (sender, e) => { UpdateAddressables(e); };
@@ -49,7 +49,9 @@ private static void UpdateAddressables(FileSystemEventArgs e)
4949
//Debug.Log($"File watcher: {e.FullPath}");
5050
if (_isRuning)
5151
return;
52-
_isRuning = true;
52+
string fullPath = e.FullPath.Replace("\\", "/");
53+
if(fullPath.Contains("Assets/Game"))
54+
_isRuning = true;
5355
}
5456
}
5557
}

0 commit comments

Comments
 (0)