- Home /
Write file after build
I'm looking for a way to write a text-file after building in Unity.
I have an XML file that I'm formatting to a text-file. And what I need to do is save the text-file to the Desktop, and it's working using the Editor, but after you build Unity doesn't let you write text-files anymore. Is there a way I can write a file to the desktop that has text in it even after building?
Right now I'm using
File.WriteAllLines(Path.Combine(path,"data.txt"), text.ToArray());
Where is the text co$$anonymous$$g from? When Unity builds it'll recompile for the output platform and reload assemblies.
Answer by JonathanCzeck · Dec 04, 2015 at 04:16 PM
Sorry for the late reply, the text is basically a X$$anonymous$$L file I'm loading in and formatting to make it understandable and then I want to save it in a text file(or something simmilar). And save it on the desktop. I make the text using an implemented ToString method and putting text in a list and later converting it to an array. I can write the file, of course before building but I want to be able to write a file after I've built.
Your answer
Follow this Question
Related Questions
How to create and write a text file after compile/build 0 Answers
parsing csv file 2 Answers
Create Text File 3 Answers
How does a TextAsset work? 1 Answer