예제 #1
0
    public void CacheCurrentSpell(string key)
    {
        string componentString = "";

        foreach (AuricaSpellComponent c in currentComponents)
        {
            componentString += c.c_name + ", ";
        }
        componentString = componentString.Substring(0, componentString.Length - 2);
        Debug.Log("Caching spell: " + componentString);

        if (cachedSpells.ContainsKey(key))
        {
            cachedSpells[key] = new CachedSpell(componentString);
        }
        else
        {
            cachedSpells.Add(key, new CachedSpell(componentString));
        }
        PlayerPrefs.SetString("CachedSpell_" + key, componentString);
        Debug.Log("Spell cached under key: CachedSpell_" + key + " with string -> " + componentString);
        AuricaSpell match = Cast();

        try {
            BindingUIPanel.LocalInstance.SetBind(key, match);
        } catch {
            Debug.Log("No spell found for binding...");
            BindingUIPanel.LocalInstance.SetBind(key, null);
        }
    }
예제 #2
0
    public AuricaSpell CastBindSlot(string slot)
    {
        if (cachedSpells.ContainsKey(slot))
        {
            ResetCast();
            CachedSpell cachedSpell = cachedSpells[slot];
            cachedSpell.AddComponents(this);
            return(Cast());
        }

        return(GetSpellMatch(new List <AuricaSpellComponent>(), new ManaDistribution()));
    }
예제 #3
0
    public void CacheSpell(string key, string spell)
    {
        Debug.Log("Caching spell: " + spell);
        if (cachedSpells.ContainsKey(key))
        {
            cachedSpells[key] = new CachedSpell(spell);
        }
        else
        {
            cachedSpells.Add(key, new CachedSpell(spell));
        }
        PlayerPrefs.SetString("CachedSpell_" + key, spell);
        AuricaSpell match = CastSpellByName(spell);

        try {
            BindingUIPanel.LocalInstance.SetBind(key, match);
        } catch {
            Debug.Log("No spell found for binding...");
            BindingUIPanel.LocalInstance.SetBind(key, null);
        }
    }