- Home /
Refresh assets during build.
How can I refresh the assets or a specific asset during a build? I have an xml file that is not updating and I need to manually refresh it from the assets folder. I can't be doing that in my build. How do I solve this problem?
Answer by dorpeleg · Jun 27, 2013 at 06:04 AM
Run this: AssetDatabase.Refresh();
After saving the XML.
But this is only for the editor. Is there anything I can do that would work inside a build?
I'm not sure it's possible (if anyone knows otherwise, please correct me).
Can you share some more details?
$$anonymous$$aybe I can think about a different solution for your problem.
What can you do to refresh the screen to put the new updated information? You want me to take a video and show you what I mean?
Can you explain what kind of data are you saving?
How are you saving the xml?
This is the function that Im using to save:
public static void Save(AllWeapons everyWeapon, string path)
{
XmlSerializer mySerializer = new XmlSerializer(typeof(AllWeapons));
using(var stream = new FileStream(path, File$$anonymous$$ode.Create))
{
mySerializer.Serialize(stream, everyWeapon);
}
}
The "AllWeapons" is the script name