I have a game and I am doing now the UI (GUI) for that game to set some parameters. One of this parameter should be the duration of this game (in minutes). How can I define that when I type for example 3 in the input field , that the game should run 3 minutes?
Thank you for your help!
Edit:
Here the code I have so far:
public void DurationGame() {
float myTimer = 5.0f;
if (myTimer > 0) {
myTimer -= Time.deltaTime;
}
if (myTimer <= 0) {
//Game should stop here
Debug.Log ("GAME OVER");
}