Im trying to make a 3 countdown timer but when i press a button all of them decreases at the same time. each countdown timer has a different length of time. 15, 30 and 22 seconds
void Update()
{
timer -= 1 * Time.deltaTime;
timer15currenttimer -= 1 * Time.deltaTime;
}
void OnGUI()
{
if (exer == "30")
{
timer = 30f;
tresttiemr.text = timer.ToString("0");
}
if (exer == "15")
{
countdownText.text = timer15currenttimer.ToString("0");
}
}
public void fb()
{
exer = "30";
OnGUI();
}
public void sb()
{
exer = "15";
OnGUI();
}
this is what i use to try it.