2
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

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.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Since I'm using xml data and a TextAsset, "The correct answer is to create an AssetPostprocessor and override the OnPostprocessAllAssets method." -- answers.unity3d.com/questions/17831/… \$\endgroup\$
    – milkplus
    Oct 14, 2012 at 4:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .