Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to detect asset change while running in the unity editor. When I update my model, I see it change but the xml data associated with it does not change. So it would be nice to detect that and reload the xml data while running in the unity editor.

share|improve this question
up vote 2 down vote accepted

Try OnPostprocessModel (on asset pipeline objects only; does not work on regular scripts) which should be called anytime a model is imported. There are similar hooks for textures and so on as well.

If that doesn't work, or if you want to monitor files that don't correspond to Unity assets, you can set up your own file monitor using FileSystemWatcher to check for any new, modified, or deleted files.

share|improve this answer
Since I'm using xml data and a TextAsset, "The correct answer is to create an AssetPostprocessor and override the OnPostprocessAllAssets method." --… – milkplus Oct 14 '12 at 4:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.