private void AddWatchedFilesForUxml(VisualTreeAsset vta) { #if UNITY_2020_1_OR_NEWER foreach (var asset in vta.templateDependencies) { var path = AssetDatabase.GetAssetPath(asset); if (!string.IsNullOrEmpty(path)) { FileWatcher.Instance().AddFile(this, path); } AddWatchedFilesForUxml(asset); } foreach (var asset in vta.stylesheets) { var path = AssetDatabase.GetAssetPath(asset); if (!string.IsNullOrEmpty(path)) { FileWatcher.Instance().AddFile(this, path); } } #endif }
private void RemoveWatchedFiles() { #if UNITY_EDITOR FileWatcher.Instance().RemoveAllFiles(this); #endif }
private void StopWatchingFiles() { #if UNITY_EDITOR FileWatcher.Instance().DisableWatcher(this); #endif }