How can I logic start my game with the main menu and then to start a new game or resume a game ?

I have two scenes. Main Menu , my gameplay scene : When running the game it start with the main menu scene.
In the main menu scene I have a button name PLAY that start a new game.
On the Main Menu object I have attached a MainMenu script :

Each time I click on PLAY a new game start :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class MainMenu : MonoBehaviour
{
    public void PlayGame()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1, LoadSceneMode.Additive);
    }

    public void QuitGame()
    {
        Application.Quit();
    }
}

My gameplay scene is name The…(I deleted the name).
In this scene I have a Game Manager object and a Back to main menu child with a script attached to it :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class BackToMainMenu : MonoBehaviour
{
    // Variables
    private bool _isInMainMenu = false;
    public GameObject mainGame;

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (!_isInMainMenu)
            {
                SceneManager.LoadScene(0, LoadSceneMode.Additive);

                // -- Code to freeze the game
                mainGame.SetActive(false);
            }
            else
            {
                SceneManager.UnloadSceneAsync(0);
                // -- Code to unfreeze the game
                mainGame.SetActive(true);
            }

            _isInMainMenu = !_isInMainMenu;
        }
    }
}

Under Main Game I have all my gameplay objects.

The idea is when starting to game that the Main Game is disabled. Enabled false.
And when I click the PLAY button the Main Game should be enabled true. But since Main Game is not in the same scene of the Main Menu I can’t use it in the MainMenu script.

I wanted to use also the Main Game object here :

public void PlayGame()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1, LoadSceneMode.Additive);
    }

When I click the PLAY button enabled true the Main Game.

And then by logic while the game is running if I press the ESCAPE key once it will be back to the main menu and the Main Game will be enabled false disabled again like pause.

And if I press the ESCAPE key second time it will enable true the Main Game and will continue from last point like resume.
The problem in this operation is for some reason when I press the ESCAPE key second time it’s starting the game over again and not resuming it.

The logic operation as I see it and what it should do :

  1. Game start with main menu scene.

2 PLAY button to start a new game.

  1. ESCAPE key to pause/resume the game.

Because of the way you’re doing this, the first thing I’d do is go through every OnEnable and OnDisable method for everything under the mainGame object. You’ll need to make sure nothing to do with restarting or ending the game is in those methods.