public void PowerDown() { if (powerCntr > 1) { freePoints += 1; powerCntr -= 1; HeroCharacteristics heroChars = heroes[curnum].GetComponent <HeroCharacteristics>(); healthCntrerCntr = heroChars.CalcHealth(powerCntr); 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(); }