my ingame clock increments instead of speeding up. i have created 3 methods between x1, x5, and x10 to speed up the clock when i press a button. here’s my code for clear understanding
Someone can help me figure it out? Thank you!
public Text DateTimeText;
float gameTimer = 0f;
void Update ()
{
gameTimer += Time.deltaTime;
int seconds = (int) (gameTimer % 60);
int minutes = (int) (gameTimer / 60) % 60;
int hours = (int) (gameTimer / 3600) % 24;
string timeString = string.Format("{0:0}:{1:00}:{2:00}",hours,minutes,seconds);
DateTimeText.text = timeString;
}
public void x1()
{
gameTimer += Time.deltaTime;
}
public void x5()
{
gameTimer += Time.deltaTime * 300;
}
public void x10()
{
gameTimer += Time.deltaTime * 600;
}