How do I dynamically reload content files?
Posted
by
Kikaimaru
on Game Development
See other posts from Game Development
or by Kikaimaru
Published on 2012-04-11T11:17:46Z
Indexed on
2012/04/11
17:42 UTC
Read the original article
Hit count: 310
XNA
|xna-content-pipeline
Is there a relatively simple way to dynamically reload content files, such as effect files?
I know I can do the following:
- Detect change of file
- Run content pipeline to rebuild that specific file
- Unload ALL content that was loaded
- Load all content
And use double references to reference content files.
The problem is with step 3 (and step 2 isn't that nice either). I need to unload everything because if I have model Hero.x
which references Model.fx
effect, and I change the Model.fx
file, I need to reload the Hero.x
file which will then call LoadExternalReference
on Model.fx
.
Has someone managed to make this work without rewriting the whole ContentManager
(and every ContentReader
) and tracking calls to LoadExternalReference
?
© Game Development or respective owner