title: How to set duration of game in UI?
body: <p>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?</p>
  
  <p>Thank you for your help!</p>
  
  <p>Edit: </p>
  
  <p>Here the code I have so far: </p>
  
  <pre><code>public void DurationGame() { 
  
      float myTimer = 5.0f; 
  
      if (myTimer &gt; 0) {
          myTimer -= Time.deltaTime;
      }
  
      if (myTimer &lt;= 0) {
  
          //Game should stop here
  
          Debug.Log ("GAME OVER"); 
      }
  </code></pre>