New Unity user here, picking my way through some simple projects. I’m working on a very simple menu-driven project that lets the user create starship weapon data (i.e., a weapon builder for what is currently a tabletop game I’ve designed). I would like to be able to save the user’s data to a discrete file so that it can be shared with other users. The idea would be that the filename would be the name of the weapon, and its contents would be a very boring flat text file, basically a database output (weapon name, damage values, range values, accuracy values, and so on). And then the data could be read into the project and displayed in the GUI.
I know that I could cobble something together in PlayerPrefs (making PlayerPrefs fields with the weapon name as the prefix), but that would make the data non-portable.
Most of what I’ve read on the subject comes down to two answers:
- Really, use PlayerPrefs, you’ll feel better.
- Reading and writing files is stupid.
But there’s got to be a better answer. Should I be using system.IO (in spite of all the people saying not to, see #1 above) and learning how to put together C# code for this specific purpose?
(My programming background is embarrassing. Basically, a bit of Objective C and a whole lot of NeverScript from NWN2 when I was administering a server, back in the day.)
I’m not necessarily looking for concrete script solutions (though that would be nice!), I’m really asking about the best approach to the problem.