Reading external configuration files not working in the final compiled version.

Whats causing this? because my config “ini” files are perfectly working in the editors player, but when i compile the project, its not reading the data. I’m loading a ini throuh a ini, may this be the case? If so, then how can i make it work the way i want (to load another ini thorugh a configuration ini file)?

I’m using this comand to read ini’s:
iniFile = new StreamReader( Application.dataPath + “/Data/” + iniPath+“.ini” );

So is this my fault or is this a bug? Because this is a feature i’d like to have and it would be a good thing, if this is my own fault, so that i can get this working eventually.

Whereabouts are the ini files on disk, during edit and also in builds?

assets\data is my folder for inis, is this ok? or should i not use assets folder?

?

Build your compiled version to it’s own folder. You’ll have an exe and a single “yourappname_data” folder.

Just put the files you want to reference in the same folder as your .exe. If you want them in the “yourappname_data” folder, reference it as

Application.StartUpPath + “\yourappname_data”

Application.dataPath has got nothing to do with Unity’s data path. Go and google the .NET API for what it’s used for.

Thanks for the reply Meltown, I think you ment “Application.dataPath” ?

anything thats inside assets and not inside StreamingAssets is either not part of the build (if not used on a scene object or resource object) or it is part of the build but no longer as distinct file cause all resources unity includes are packaged into .NET resource files.

What you want to do is put the ini into Assets/Streaming assets and then see where that ends on your target platform in the build (for iOS its Application.dataPath + “/Raw/” for example)

Thanks got this working, now ive got an extra question, how can i do so that it works with web players?