Asset source file change detection in Unity Editor?


  • We have a text file X in Asset Folder.
  • We have a Z.bat file that reads X and generates a Y file. Y is a .cs script file.
  • This is cumbersome, because we need to check whether X is changed (e.g. after getting the latest version from non-UnityAssetServer source repository) and should run Z.bat.


  • We want UnityEditor to detect whether X is changed and automatically run Z.bat.
  • We guess this can be done by making an Editor-classes-derived script file, but we have no idea where to start.


  • Please let me know how to make an Editor plugin which detects Asset file change and do something.

you should just learn how to write Unity Editor plugins. Any number of online tutorials/examples are available, and it’s very useful. Then, I think you can hook into one of these events: Unity - Scripting API: AssetPostprocessor