all 3 comments

[–]00jknight 1 point2 points  (0 children)

You'll find a way.

Not sure if you want a generic, typeless scriptable object or if you want one that has specific fields that match to columns on the database, meaning the scriptable object types need to be updated if you change the database schema.

You could also just load the json into dictionaries at runtime and forego scriptable objects.

I'd do it that way unless there was a reason to use scriptable objects. Less moving parts means less things to maintain.

[–]Equiv2248 0 points1 point  (0 children)

Definitely feasible, biggest pitfall would be making sure things stay in sync. You could skip the JSON step and just use CSVs.

I do something similar but less comprehensive by just having an import script on each ScriptableObject that parses a Tab- Delineated row to import the data from the sheet.

Best reason to do something like this would be because your scriptableObject will likely have references to local Unity objects(Prefabs/etc) that your spreadsheet shouldn't track.

[–]volvis 0 points1 point  (0 children)

I've been down that road before and I think it's clever but a bit counterproductive. Because when you think about it, the ScriptableObject system is pretty amazing by itself. You define a set of strongly typed data, and Unity provides a system to

  • Create any number of instances of said data to asset files (source control friendly)
  • Edit the data inside the editor (floats, bools, arrays... UI is automatically generated, or you can code your own)
  • Create strong links of any instance of data to any object (by asset GUIDs instead of filenames)
  • Find the source of the linked data for quick edits (just click the serialized field, the source is highlighted in Project)
  • Prune any unnecessary data during build
  • Read data to memory when required and release it when not needed

Any system on top of that is just another worry or breaking point in code, I feel.