Array of scripts on component

Hey!

I’m currently experimenting with Unity and I like it. However, I’ve encountered something that seems a bit odd to me.

I’ve got a base class; SpellBase which is abstract and only contains a Texture2d property and field. It also contains an abstract method “Execute”.

I also got an UnitBase class which is not abstract. This class then has an array of Spell base.
My idea was to populate this array of spell base with scripts to my prefabs. However, the array only accepts GameObjects in my scene.

Is there a way to allow scripts/components as part of another component?

I’d like to avoid having all my spells as “normal” components, the list would get so long from all spells I’ve been planning for play around with.

Thanks in advance
Kevin

My best guess would be to make spells not inherit from MonoBehaviour and to make Spells serializable

[System.Serializable]
public class Spells //remove MonoBehaviour here 
{
//cool stuff
}