using System.Collections.Generic; using UnityEditor; public class ChangedConfigsProcessor : AssetPostprocessor { private static void OnPostprocessAllAssets( string[] imported, string[] deleted, string[] moved, string[] moved_from_paths ) { var accum = new List(); FilterConfigFiles(imported, accum); FilterConfigFiles(deleted, accum); FilterConfigFiles(moved, accum); FilterConfigFiles(moved_from_paths, accum); if (accum.Count == 0) return; //TODO: animate it properly someday EditorUtility.DisplayProgressBar("Building configs", "In progress...", 0.3f); try { BuildUtils.Urun(); } finally { EditorUtility.ClearProgressBar(); } } private static void FilterConfigFiles(IEnumerable paths, ICollection accum) { foreach (string path in paths) if (path.EndsWith(".conf.js") || path.EndsWith(".bhl")) accum.Add(path); } }