void SetPauseMenuActivation(bool active) { menuRoot.SetActive(active); if (menuRoot.activeSelf) { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; Time.timeScale = 0f; AudioUtility.SetMasterVolume(volumeWhenMenuOpen); EventSystem.current.SetSelectedGameObject(null); TelemetryLogger.LogMenuChange("Play", "Pause", m_PlayerInputsHandler.transform.position); } else { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; Time.timeScale = 1f; AudioUtility.SetMasterVolume(1); TelemetryLogger.LogMenuChange("Pause", "Play", m_PlayerInputsHandler.transform.position); } }