示例#1
0
    public Spell GetRandomSpell(AreaOfEffect.SpellType type)
    {
        List <Spell> typeSpells = GetSpells(type);

        if (typeSpells.Count > 0)
        {
            int rand = Random.Range(0, typeSpells.Count - 1);
            return(typeSpells[rand]);
        }
        return(null);
    }
示例#2
0
    public List <Spell> GetSpells(AreaOfEffect.SpellType type)
    {
        List <Spell> outputSpells = new List <Spell>();

        foreach (Spell spell in m_spells)
        {
            if (spell.m_prefabEffect.GetSpellType() == type)
            {
                outputSpells.Add(spell);
            }
        }
        return(outputSpells);
    }