Event - Freezes program when called

Hello,
I’m making game where gameMenu Canvas should be displayed when I release Q button.
For this I have created MenuToggle class which looks like:

public class GameManager_MenuToggle : MonoBehaviour
    {

        public GameObject menuUI;
        public string menuButton;       

        private GameManager_Master gameManagerMaster;        
       
        private void OnEnable()
        {
            SetInitialReferences();
            gameManagerMaster.MenuToggleEvent += MenuToggle;
        }

        private void OnDisable()
        {
            gameManagerMaster.MenuToggleEvent -= MenuToggle;
        }

        void SetInitialReferences()
        {
            gameManagerMaster = GetComponent<GameManager_Master>();
        }


        private void Update()
        {
            CheckForMenuToggleRequest();
        }

        void CheckForMenuToggleRequest()
        {
            if (Input.GetKeyUp(KeyCode.Q))
            {
                MenuToggle();
            }
        }

        void MenuToggle()
        {
            if (menuUI != null)
            {                
                menuUI.SetActive(!menuUI.activeSelf);
                Debug.Log("MenuToggle - change UI State");
                gameManagerMaster.isMenuOn = !gameManagerMaster.isMenuOn;
                gameManagerMaster.CallEventMenuToggle();
            }
        }
    }

As you can see I’m using GameManager_Master class which is like (I’ve cut stuff not relevent to this event):

public class GameManager_Master : MonoBehaviour 
	{

        public delegate void GameManagerEventHandler();
        public event GameManagerEventHandler MenuToggleEvent;
       
     
        public bool isMenuOn;

     
        public void CallEventMenuToggle()
        {
            if (MenuToggleEvent != null)
            {
                MenuToggleEvent();
            }
        }

        private void OnLevelWasLoaded(int level)
        {
            Time.timeScale = 1;
        }

    }

What is more when MenuToggleEvent is called my event system should trigger a Pause with script:

public class GameManager_PauseToggle : MonoBehaviour
    {
        public GameObject playerController;
        private GameManager_Master gameManagerMaster;
        private bool isPaused;

        private void OnEnable()
        {
            SetInitialReferences();
            gameManagerMaster.MenuToggleEvent += PauseToggle;
            //gameManagerMaster.SpawnMenuToggleEvent += PauseToggle;
        }

        private void OnDisable()
        {
            gameManagerMaster.MenuToggleEvent -= PauseToggle;
            //gameManagerMaster.SpawnMenuToggleEvent -= PauseToggle;
        }

        void SetInitialReferences()
        {
            gameManagerMaster = GetComponent<GameManager_Master>();
        }

        void PauseToggle()
        {
            if (isPaused)
            {
                Time.timeScale = 1;
                isPaused = false;
                playerController.GetComponent<FirstPersonController>().canRotate = true;
            }
            else
            {
                Time.timeScale = 0;
                isPaused = true;
                playerController.GetComponent<FirstPersonController>().canRotate = false;
            }
        }
        
    }

All my stuff is in one single namespace called Simulator.
I am using Unity v 5.6.0f3.

You have an infinite recursion in your “GameManager_MenuToggle” script. You subscribe the method “MenuToggle” to the “MenuToggleEvent” inside the “GameManager_Master” script. However inside your MenuToggle method you call “CallEventMenuToggle” which in turn will call your “MenuToggleEvent” which again will call the MenuToggle method since it’s subscribed to the event.

When you design events you should exactly define who is responsible for raising that event to avoid such problems.