How do I make a variable ‘max out’ at a certain point?
Another way to word this is, 'how do I make a level cap?
I think I’m supposed to place an If(Count == 50) statement, but The compiler says I can’t because ‘Count’ is an int.
Thank you in advance!
Code:
void Update()
{
ItemInfo.text = itemName + "
Cost: " + cost + "
Power: +" + clickpower;
_Slider.value = Click.Click / cost;
if (_Slider.value >= 1.0f)
{
GetComponent<Image>().color = Affordable;
}
else
{
GetComponent<Image>().color = standard;
}
}