Quick Tip for Storing Data (Unity)
https://ldjam.com/events/ludum-dare/50/corrupted-caverns
There are many things to keep track of in our game: which items do what, crafting recipes, block data, etc. I wanted to share how we used scriptable objects to easily edit and access that data.
We start by writing the script for the scriptable object. This will contain a struct with all the different data that we need to know, in this case for blocks. Make sure to mark everything as public and the struct as serializable. Now we simply make an array or list of the struct.

We also need a way of fetching data, which we can easily do with .Find()

We can create an instance of this scriptable object and put our data into it.

To easily be able to access this data from anywhere in our project, we set them in a game manager script.



Now we can easily access the data anywhere, simply by writing GameManager.Instance.[scriptable object name]!

Check out our game to see this in action: https://ldjam.com/events/ludum-dare/50/corrupted-caverns