I am trying to set up way for the player to select spells during combat. I need to put them into an array so that I can I list them and scroll through them. Being a newbie to Unity Script I thought the best way to go about doing it was make a base class which would be Spell, and create my spells either by extending the spell class or just creating them from the class in a spell manager class.
So I was thinking my array would be:
var spells : Spell[];
and then add stuff like this:
fireball = new Spell("Fireball");
spells.Add(fireball);
And I get an error thats says type has to be derived from UnityEngine.Object. Type is Spell.
Are there any solutions to make my array work correctly? And if I’m going about it all wrong, how would I get an array of abilities?