public void intelligenceDown() { if (intelligenceCntr > 1) { freePoints += 1; intelligenceCntr -= 1; HeroCharacteristics heroChars = heroes[curnum].GetComponent <HeroCharacteristics>(); damageCntr = heroChars.CalcDamage(intelligenceCntr); SetupMainCharacteristics(powerCntr, agilityCntr, intelligenceCntr); SetupUIComponents(); } }
void ChangeHero(int num) { gameObject.GetComponentsInChildren <Image>()[1].sprite = heroes [num].GetComponent <SpriteRenderer>().sprite; gameObject.GetComponentInChildren <TMP_Text> ().text = heroesNames [num]; HeroCharacteristics heroChars = heroes[num].GetComponent <HeroCharacteristics>(); SetupMainCharacteristics(heroChars.power, heroChars.agility, heroChars.inteintelligence); damageCntr = heroChars.CalcDamage(intelligenceCntr); healthCntrerCntr = heroChars.CalcHealth(powerCntr); evasionCntr = heroChars.CalcEvasion(agilityCntr); freePoints = 0; SetupUIComponents(); }