Make it so you can press esc to get out of stats menu

This commit is contained in:
Lncvrt committed 2025-10-11 13:29:05 -07:00
1 parent 92c7ef7ec7
commit ee2537b32f
2 files changed
+5 -3

No files matched your search

+5 -2
View File
@@ -32,7 +32,6 @@ public class GamePlayer : MonoBehaviour
public TMP_Text boostText;
public GameObject bird;
public GameObject pausePanel;
public GameObject statsPanel;
public Rigidbody2D rb;
public AudioSource backgroundMusic;
private float lastMoveTime;
@@ -591,7 +590,11 @@ public class GamePlayer : MonoBehaviour
internal void TogglePause()
{
if (statsPanel.activeSelf) return;
if (GamePlayerPauseMenu.Instance != null && GamePlayerPauseMenu.Instance.statsMenu.activeSelf)
{
GamePlayerPauseMenu.Instance.statsMenuExitButton.onClick.Invoke();
return;
}
if (pausePanel.activeSelf)
{
DisablePause();