Reloading scene is best for start new game?

For start new game, I should all variables reset to initial value. Normallly game has many variables several tens~hundreds~

So how can I reset all of them? And there is possibility I forget something.

Then reloading scene itself is best way?

Or other way for new game?

Thanks.

As you wish. I think it’s ok - if your game has a lot of levels and each level is different scene - you will load scene every time when you’ll start new level.

But if you don’t want to reload scene and don’t want forget reset something, I reccoment you to define special class to store gamestates and recreate it instead of reload scene. See snippet bellow:

public class MyGame : MonoBehaviout
{
   private GameState _state = new GameState();

   void OnGUI()
   {
      GUI.Label(new Rect(3,3,100,100), _state.Score));
   }

   void ResetGame()
   {
      _state = new GameState();
   }
}

public class GameState
{
   public int Score {get;set;}
}