So, I was testing my number wizard Ui code and I find a error.
This is my code:
// Use this for initialization
void Start()
{
NextGuess();
}
void StartGame()
{
}
public void OnPressHigher()
{
min = guess+1;
NextGuess();
}
public void OnPressLower()
{
max = guess-1;
NextGuess();
}
void NextGuess()
{
guess = Random.Range(min, max + 1);
guessText.text = guess.ToString();
}
}
When I click on lower or higher button my max and min goes crazy. It keeps adding +1 or subtracting -1. It never stops…
I was acting like a user, so I found this error, how to fix it?