I just started a new project to learn using scriptable objects and I cant wrap my head around the correct way to approach this setup.
So basically I have a few script which i think are relevant.
SOitem- the scriptable objects which holds information like id and sprite
AbstractSoitem - An abstract class using the SOItem
BasicItem -- Class using AbstractSoitem having a method like ApplyPoints()
I wanted to calculate some points for every gameobject, where they will have slightly different logic regarding the calculations, some just give points some will increase points from other nearby gameobjects and so on.
My question now is, what is the right approach to handle the logic of the calculations? Lets say there are 2 different types, basic (just adds basePoints) and special (gives basepoints but also increases the basepoints of nearby items).
Currently im looping through all the gameobjects and calling a function. Should I give every SOItem the appropiate function so I can just do gameobject.SoItem.Function() to get the points or should this logic be on the gameobject, so that I would call gameobject.Function(SOItem) which will then use some variables of the SOItem to idk search a switch case to select the correct calculation logic?
Besides im a little confused if the setup with abstract classes revolving around the SOItem even makes sense.