Answer the question
In order to leave comments, you need to log in
The function does not work as expected. How to fix it?
Hello, I made it so that you could specify the price of the product and the bonus in the unit itself (I do it according to this guide https://www.youtube.com/watch?v=WOd22Az66SY&t=712s . This moment starts at about 14:00). Did everything right. I indicated both the price and the bonus, but when buying an improvement with enough funds, it gives an error in the log (Insufficient funds). The code:
[Header("Работа")]
private int workersCount;
public int [] rabotaCena;
public int [] rabotaBonus;
public void workPan_addClickerScore(int index)
{
if (score >= rabotaCena[index])
{
bonus += rabotaBonus[index];
score -= rabotaCena[index];
}
else
{
Debug.Log("Ошибка");
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question