public void BuyCompany(int number) { if (requirement.requirement == "") { musicController.CoinSound(); allPoints.AddFoodLimit(itenLimit); allPoints.money -= CompanyValue; NumberOfCompany += number; CompanyValue += SetCompanyValue; PlayerPrefs.SetInt("FoodCompanieValue", CompanyValue); allPoints.AddNature((int)(afectNature * PlayerPrefs.GetFloat("Difficult"))); allPoints.Addfood(afectFood); allPoints.AddPower((int)(afectEnergy * PlayerPrefs.GetFloat("Difficult"))); allPoints.AddPopulation((int)(afectPopulation * PlayerPrefs.GetFloat("Difficult"))); } else { musicController.ClickSound(); errorMessage.Instantiate(requirement.requirement, 5); } }