When i click my ui button it changes the text once. then my script wont change the text back when clicked again. Ive tried about everything i can think of so asking for help here. guessing im overtired and missing it. the debug log only prints “1”, one time, every time i click the button.
public void HealthBars()
{
if (PlayerPrefs.GetInt("HealthBars") == 1)
{
PlayerPrefs.SetInt("Healthbars", 0);
HBButton.text = "Turn On Enemy Healthbars Test";
Debug.Log("0");
}
else
{
PlayerPrefs.SetInt("Healthbars", 1);
HBButton.text = "Turn Off Enemy Healthbars Test";
Debug.Log("1");
}
}