title: How to create a time counter using C# in Unity 3D
body: <p>I would like to create a time counter to my Unity 3D game. </p>
  
  <p>I've already tried to use Time.time but I can't reset the timer without resetting the whole game. timeSinceLevelLoad doesn't work for me either because reloading the level is required.</p>
  
  <p>I've tried to use Time.deltaTime inside the FixedUpdate but I feel like the time isn't right. The reason I can't reload the game or the level is that I made my machine state to be one scene only:</p>
  
  <pre><code>switch (currentState) {
  
          case GameStates.START:{
              player.position = startPositionPlayer;
              currentState = GameStates.WAITGAME;
              timeScore.renderer.enabled = false;
          }
              break;
  
          case GameStates.WAITGAME:{
              player.position = startPositionPlayer;
              timeScore.renderer.enabled = false;
          }
              break;
  
          case GameStates.INGAME:{
              time = Time.time;
              timeScore.text = time.ToString();
          }
              break;  
  
          case GameStates.GAMEOVER:{
              currentState = GameStates.RANKING;
              player.position = startPositionPlayer;
              enemy.position = startPositionEnemy;
              timeScore.renderer.enabled = false;
          }
              break;
  
          case GameStates.RANKING:{
              player.position = startPositionPlayer;
              enemy.position = startPositionEnemy;
              timeScore.renderer.enabled = false;
          }
              break;
          }
      } 
  </code></pre>
  
  <p>So my whole game runs in a single scene. This function is used to restart the game using GameStates.INGAME:</p>
  
  <pre><code>public void StartGame(){
      time = 0f;
      timeScore.renderer.enabled = true;
      currentState = GameStates.INGAME;
  } 
  </code></pre>
  
  <p>My question is: <strong>How can I create a progressive time counter that I can reset without the need to reload the game, scene or level?</strong></p>