lundi 9 octobre 2017

Unity for every 25 numbers

So i had this:

if (bought.count == bought.needForUpgrade)
        {
            bought.timeToComplete /= 2;
            bought.needForUpgrade += 25;
        }

It was good, but i made a buy function so you can buy items by 1,10,25 And i want to reduce the bought.timeToComeplete by 2 for every 25 number its count passes, so for example i have 1 from that item, then i decide to buy 25, then i'll have 26. I could do it with a lot of if statements but i dont want to write it all day that if(bought.count >= 25 && bought.count <= 50) .. etc

Aucun commentaire:

Enregistrer un commentaire