Currently I’m using Json configs in the Resources folder to load an immutable data. Is storing such data in the Scriptable Objects would more preferrable way when working with Unity, or this is solution is near same?
There are pros and cons as usual.
in favor of scriptable objects:
- it’s fast to read them up, since they stored serialized
- it’s loaded more or less automatically if you refer to them
- standard in Unity, you can edit them in the editor without text editors
- you can employ the inspector
- you can change them while you’re running in the editor
in favor of JSON:
Lol. At least a couple of things in favour of json:
- you can edit them in a text editor without unity
- you can reasonably expect to be able to process them in (insert every other programming language / environment here)
Personally i use both. Packages such as the excellent fullserialiser are very useful for json
Also clients can (e.g. edit settings for archviz), that´s why I use JSON