public void SpellInfo(SpellSelectIcon spellSelectIcon) { if (!spellSign.gameObject.activeInHierarchy) { spellSign.gameObject.SetActive(true); } ISpell spell = spellSelectIcon.spell.GetComponent <ISpell>(); spellName.text = spell.Name; spellType.text = spell.SpellType.ToString(); spellManaCost.text = spell.ManaCost.ToString(); spellDescription.text = spell.Description; spellSign.sprite = spellSelectIcon.spellSign; UpdateAddSpellButton(spellSelectIcon); }
public void UpdateAddSpellButton(SpellSelectIcon spellSelectIcon) { addSpellButton.onClick.RemoveAllListeners(); if (SpellIsPrepared(spellSelectIcon.spell)) { if (Player.spellsPrepared.Count == 4) { startButton.onClick.AddListener(delegate { FindObjectOfType <LevelManager>().NextLevel(); }); startButton.gameObject.GetComponent <Text>().color = Color.cyan; } addSpellButton.gameObject.GetComponent <Text>().text = "REMOVE SPELL"; addSpellButton.onClick.AddListener(delegate() { spellSelectIcon.RemoveSpellFromLoadout(); }); } else { startButton.onClick.RemoveAllListeners(); startButton.gameObject.GetComponent <Text>().color = Color.grey; addSpellButton.gameObject.GetComponent <Text>().text = "ADD SPELL"; addSpellButton.onClick.AddListener(delegate() { spellSelectIcon.AddSpellToLoadout(); }); } }