void Awake() { spellBookButton = GetComponent <Button> (); spellBookButton.onClick.AddListener(delegate { GuiManager.instance.SpellBookObject.SetActive(true); RefreshSpellBookSpells(); if (CombatManager.instance != null && GameManager.instance.state == GameStatus.BATTLE) { CombatManager.instance.SelectedSpell = null; } }); GuiManager.instance.SpellBookObject.SetActive(true); abilityPanelUI = GuiManager.instance.SpellBookObject.GetComponentInChildren <AbilityPanelUI> (); statUI = GuiManager.instance.SpellBookObject.GetComponentInChildren <StatUI> (); statUI.Refresh(GameManager.instance.CurrentGame.playerTroop.hero.stats.GetStat(StatType.MANA)); GuiManager.instance.SpellBookObject.SetActive(false); }
public void Refresh(Ability _ability) { ability = _ability; Empty = ability == null; manaUI.gameObject.SetActive(false); if (empty) { return; } if (location == AbilityLocation.SPELLBOOK) { manaUI.gameObject.SetActive(true); Spell temp = (Spell)ability; manaUI.Refresh(temp.stats.GetStat(StatType.MANA)); } abilityIcon.sprite = ability.Icon; RefreshButton(); RefreshInterActibilityInBattle(); }