- Home /
ini file outside of build
So I made a .ini file for the settings in the game but I would like to have this file accessible in the build data folder. How would I go about doing this?
The build is for Windows.
Answer by CHPedersen · Sep 15, 2014 at 12:46 PM
Unity does not copy non-Asset files to the build folder automatically, but you can put the file there yourself. Or you can make sure the file is interpreted as an asset by Unity (make it a text asset instead of an ini-file), and then access it in-game using Resources.Load. Then Unity builds the file into its assets.resources file in the [yourGameName]_Data folder at post-build.
If you really need to make it an ini-file and keep out of Unity's build pipeline, you have to copy it to the target location in the build folder yourself, and read it using standard .Net API, i.e. streamreaders, XML documents or System.IO.File.ReadAllLines, or whatever method fits the format your ini file is in.
Well manually copying the file to the data folder seems to work. However this feels like a strange solution..
Your answer
![](https://koobas.hobune.stream/wayback/20220613163035im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Resetting config for build, such as Input settings. 0 Answers
Remove 800x500 From Build Configuration 0 Answers
Physics acting different in build than in editor 2 Answers
how to include resources to build? -1 Answers