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); } }
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())); }
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); } }