void LoadHeroes() { HeroesData data = SaveSystem.LoadHeroes(); //all heroes for (int i = 0; i < AllHeros.heroes.Length; i++) { AllHeros.heroes[i].maxHP = (int)data.allMaxHp[i]; AllHeros.heroes[i].attackDamage = (int)data.allAttackDamage[i]; AllHeros.heroes[i].critChance = (int)data.allCritChance[i]; } //heroes for (int i = 0; i < data.count; i++) { Fighter f = new Fighter(AllHeros.GetFighter(data.id[i])); f.setID(data.id[i]); f.currentHP = (int)data.currentHP[i]; Heroes.AddHero(f); } }
public void onHeroBuyClick(int itemID) { if (getItemByID(itemID).price <= Vault.money) { Fighter f = new Fighter(AllHeros.GetFighter(itemID)); f.setID(itemID); Heroes.AddHero(f); Vault.addMoney(-getItemByID(itemID).price); nextLevelButton.interactable = true; upgradeButton.interactable = true; isMandatory = false; } updateBalance(); setQuantityTexts(); //Tutorial load if (!Tutorial.isCompleted && !FindObjectOfType <TutorialShop>().isUpgradesCompleted) { FindObjectOfType <TutorialShop>().loadTutorialUpgrade(); FindObjectOfType <TutorialShop>().isUpgradesCompleted = true; } }
/// <summary> /// Prideda herojų į herojų konteinerį /// </summary> /// <param name="hero">Herojus</param> public void AddHero(Hero hero) { Heroes.AddHero(hero); }