public void AddProducingBonus(string name, int val) { BattleBonus bb = ResourceController.instance.allBattleBonuses.Find(x => x.getBonusName == name); ProdMods PM = new ProdMods(); PM.prodBonus = bb; PM.val = val; //PM.specName = ""; PM.specName = bb.getBonusName; producingBonuses.Add(PM); if (producingBonuses.Count == 1) // Только началось заполнение { // Составляем задачу и обращаемся к Production Controller MakeNewProduct(); } }
public void MakeNewProduct() { //string prodName = ResourceController.instance.GetEteModificationName(producingBonuses[0].prodBonus.getBonusName); string prodName = producingBonuses[0].prodBonus.getBonusName; int val = producingBonuses[0].val; float productspeed = producingBonuses[0].prodBonus.getBonusRecruitTime; ProdMods PM = producingBonuses[0]; PM.specName = prodName; producingBonuses[0] = PM; ProductTask pt = new ProductTask(prodName, val, productspeed, ProductionController.ProductType.bonusProd); pt.SetBonusInfo("", buildNum); ProductionController.instance.AddNewProduct(pt); }