Пример #1
0
 public void AgilityDown()
 {
     if (agilityCntr > 1)
     {
         freePoints  += 1;
         agilityCntr -= 1;
         HeroCharacteristics heroChars = heroes[curnum].GetComponent <HeroCharacteristics>();
         evasionCntr = heroChars.CalcEvasion(agilityCntr);
         SetupMainCharacteristics(powerCntr, agilityCntr, intelligenceCntr);
         SetupUIComponents();
     }
 }
Пример #2
0
 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();
     }
 }
Пример #3
0
 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();
     }
 }
Пример #4
0
    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();
    }
Пример #5
0
    public void AcceptChoise()
    {
        var prefs = NetworkManagerCustom.singleton.spawnPrefabs;
        HeroCharacteristics prefChars = prefs[curnum + 1].GetComponent <HeroCharacteristics>();
        var defaultPower        = prefChars.power;
        var defaultAgility      = prefChars.agility;
        var defaultintelligence = prefChars.inteintelligence;
        var defaultHealth       = prefChars.GetHealth();
        var defaultDamage       = prefChars.GetDamage();
        var defaultEvasion      = prefChars.GetEvasion();

        prefChars.SetCharacteristics(powerCntr, agilityCntr, intelligenceCntr, healthCntrerCntr, damageCntr, evasionCntr);
        ClientScene.AddPlayer(curnum);
        prefChars.SetCharacteristics(defaultPower, defaultAgility, defaultintelligence, defaultHealth, defaultDamage, defaultEvasion);
    }