Hello guys, I’ve been looking around for answers but I found very very few, so here we go.
I made a window event system and I’m trying to save some variables setted in these windows in an external file 'cause Unity doesn’t save.
Since I’m talking about an event for every object on the scene, I’m using the LitJson library to save everything as a json object.
The problem is the following one: The streamWriter is only able to rewrite the whole document. I call the save function from the window and every object has his own window. This means that every time I save a new object, the old one gets deleted.
I don’t want to create a file for every object or event on the scene, it would be a suicide.
Is there a way to check: If the object already exists, rewrite only that object, if not, create a new one and preserve the previous one?
EDIT: I forgot to say that I write the to save informations with a JsonWriter() in a Stringbuilder() and then save the built string with a StreamWriter().