ScriptableObjects

So because a lot of the parts of Unity are new to me, I may not have built things in the greatest way… at least not on the first pass.

Originally I wrote the spell system with a game object that implements a script that just holds information about the spell.

public class Spell: MonoBehaviour {
    public KeyCode key;
    public GameObject effect;
    public string type;
    public string words;
    public float castTime;
    public float manaCost;
    public float effectValue;
    public string effectTarget;
    public string effectType;
    public float delayTime;
    public float expireTime;
}

SpellManager

So after watching a tutorial on ScriptableObjects I have begun moving my spell system over.

public class SpellList : ScriptableObject 
{
    public List<Spell> spellList;
}

[System.Serializable]
public class Spell 
{
    public string spellName = New Spell;
    public Texture2D spellIcon = null;
    public KeyCode hotkey = null;
    public ParticleSystem spellEffect = null;
    public SpellType type = null;
    public string incantation = ;
    public float castTime = 0.0f;
    public float manaCost = 0.0f;
    public float effectValue = 0.0f;
    public EffectType effectType = null;
    public EffectTarget effectTarget = null;
    public float delayTime = 0.0f;
    public float expireTime = 0.0f;
}

SpellList