So, I have a button that increments an int by 1 each click, using:
int EffectNumberCounter(int tempEffectNumber)
{
int effectNumberFinal;
effectNumberFinal = tempEffectNumber + 1;
return effectNumberFinal;
}
And then the button:
public void btnAddEffectClick()
{
effectNumber = EffectNumberCounter(effectNumber);
}
I want to reference the result of effectNumber, whatever it happens to be at the time, when I click the other button, which I have dubbed btnRerollEffectClick, by using if effectNumber = 1 (ETC ETC ETC), without losing the stored value of effectNumber. Unfortunately it keeps returning to 0.
What would be the way to do this?