- Home /
Reading and Writing .json after build without Resources.Load()
Hey guys :)
I am using .json (The LitJson Library) to store all kinds off stuff for my game. This includes: translations and savegames.
Here is my problem: Everything was fine when I was developing. Loading and saving worked just perfectly. But when I build the game, I got a lot of my own errors that said: "The .json script at path was not found." For finding the path I had a method that would use string path = Application.dataPath + "some more directory stuff"; After the build, that path was gone.
Actual question: How can I store my .json files so I can manipulate them later? Do I have to store some kind of references to them?
Just for some additional information: I have one .json file for each language as this makes translating very easy.
And how can I set them up that I can write to that file later? I assume that I'll have some problems, if the files I want to write for savegames are located on the C: drive.
P.S.: I don't want to use anything with Resources.Load, as this is not recommended by Unity as this article says: https://unity3d.com/de/learn/tutorials/topics/best-practices/resources-folder
Answer by ninja_gear · Mar 01, 2017 at 05:35 PM
Application.streamingPath... or something like that. It's the folder that's designed to write files at runtime.
Edit: Application.streamingAssetsPath
Your answer
