What part are you struggling with?
how to iterate a collection and sum it up?
how to sum other numbers?
basic C# syntax??
For this purpose ScriptableObjects are simply bags of data that you can edit in the inspector, so you can consider them simple object references for the purpose of syntax / design.
Otherwise, this might be useful to you:
ScriptableObject usage in RPGs:
The most important concept about ScriptableObjects (SOs) is that they are custom-shaped blobs of data that you can edit inside the Unity inspector.
The serialized values inside a SO map directly to that created asset on disk, the instance of the SO.
When your game runs, it needs some data. One way to get that data is to hard-code it in the code. That is bad because when you change it, you need to change code. That’s why we have things like a SO to configure existing unchanging shipped code.
W…
This looks like a job tailor made for ScriptableObjects!
ScriptableObjects are basically structured blobs of predefined data to help you create content for your game.
For instance if I had a ScriptableObject called Weapon, it might have these properties:
name
detailed name
description
damage
toughness
weight
what it looks like in the inventory
what model it uses in game
what animations the player uses to swing it
I would create many of these Weapons, each one a file on disk (also called an…
Usage as a shared common data container: