Is there a build-in method to read some sort of 'config' file for a Unity3D application, or do I have to use the Mono's file-reading classes?
2 Answers
2PlayerPrefs is your best friend.
You can use TextAsset files to get easy access to text
Drag any .txt file into the project and add it into your scene/resources/etc, loading it as you would a texture or any other unity asset
It'll embed your text into the application, and is easily accessible with yourTextAsset.text or yourTextAsset.bytes
They are, however, read only, so they're more useful for things which don't need to be saved back
If I need to update the file, can I just replace the text file or do I have to re-build the player?
– ExtrakunYou'd have to rebuild the player - If you want to read from a folder in the build, you'll have to go with System.IO.File.ReadAllBytes or somesuch
– anon85704231Thank you! You saved my day!
– Rustam-Ganeyev