I want to add a keycode ( prefer shift key) to my pause menu to send you back main menu
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pause : MonoBehaviour
{
[SerializeField] private GameObject pauseMenuUI;
[SerializeField] private bool isPaused;
private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
isPaused = !isPaused;
}
if (isPaused)
{
ActivateMenu();
}
else
{
DeactivateMenu();
}
}
void ActivateMenu()
{
Time.timeScale = 0;
pauseMenuUI.SetActive(true);
}
void DeactivateMenu()
{
Time.timeScale = 1;
pauseMenuUI.SetActive(false);
}
}