Example #1
0
        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
        }
Example #2
0
        private void RemoveWatchedFiles()
        {
#if UNITY_EDITOR
            FileWatcher.Instance().RemoveAllFiles(this);
#endif
        }
Example #3
0
        private void StopWatchingFiles()
        {
#if UNITY_EDITOR
            FileWatcher.Instance().DisableWatcher(this);
#endif
        }