- Home /
Best option for a config file?
New to unity. I'm working on a WebGL project and there are various URLs that change depending on if it's a developer build or release build. I have to provide some sort of config file that lets the deployers of the project change that file without needing to change the code. Is there a standard config file for this that Unity WebGL projects generally use? Or can it be literally anything and I just read it from code at startup?
How are these usually read? I'm seeing some older posts talking about a web.config file in the build folder, but I'm not seeing one being created.
You usually have to either write your own methods to read/convert to/from json/xm or you can use existing libraries to do this for json like (Newtonsoft) or the build in https://docs.unity3d.com/ScriptReference/JsonUtility.html
For xml you have to mainly do it yourself, there are a lot of ways to do it. Linq to xml is probably the easiest way to read/build xml files: https://docs.microsoft.com/en-us/dotnet/csharp/program$$anonymous$$g-guide/concepts/linq/linq-to-xml-overview
Answer by logicandchaos · Mar 18, 2020 at 09:10 PM
it could be anything, I would use a scriptableObject that you can save and load as JSON
Your answer
Follow this Question
Related Questions
iPhone System.IO.File.Exists() not working 1 Answer
[SOLVED] Bad PKCS7 While encrypting a file 1 Answer
Is accessing user documents folder possible on Unity3D? 0 Answers
CaptureScreenshot writing to Phone, but persistentdatapath linking to the external card. 0 Answers
Resources Load to open pdf is not working anymore in Android 7 0 Answers