First I want to make sure I am doing this effectively. Lets assume that I was going to create 100 enemies. Here is my setup:
- Create the base SO
[CreateAssetMenu(fileName = "Hero", menuName = "Type")]
public class Tester : ScriptableObject
{
public string Name;
public int Level;
}
-
The I would begin to create my enemies SO through the create asset menu and give them fill in those stats. I create one.
-
I need another script to do something with them right?
public class BaseClass : MonoBehaviour
{
public Tester tester;
[Header("Stats")]
public string Name;
public int Level;
// Start is called before the first frame update
void Start()
{
Name = tester.Name;
Level = tester.Level;
sprite = tester.sprite;
}
}
- Create a Game object and attach the BaseClass script to it, drag the one of the enemies SO’s into the inspector than save that as the prefab correct?
Assuming I did that correctly:
-
What is the difference between this and just making a single BaseStats script that contains all the data needed to explain characters/enemies, attaching it to all your characters/enemies and just tailoring it to each specific one? This just feels like more steps? What is the major benefit?
-
Is it possible to store sprite data(and to extension sprite animation)inside the SO. Attach it to a empty gameobject and then instantiate that sprite on play? Or just have the sprite be the gameobject and attach the script to that?
-
Would functions like attacking/healing be stored in the SO or the MonoBehaviour part?

