Fix escape not exiting from the edit ui mode but rather closing entirely in pause menu

This commit is contained in:
2026-01-26 08:00:14 -07:00
parent 0a9db35a02
commit 3cd762ee06
2 changed files with 24 additions and 28 deletions

View File

@@ -675,19 +675,8 @@ public class CustomGamePlayer : MonoBehaviour
internal void TogglePause()
{
if (CustomGamePlayerPauseMenu.Instance != null && CustomGamePlayerPauseMenu.Instance.statsMenu.activeSelf)
{
CustomGamePlayerPauseMenu.Instance.statsMenuExitButton.onClick.Invoke();
return;
}
if (pausePanel.activeSelf)
{
DisablePause();
}
else
{
EnablePause();
}
if (pausePanel.activeSelf) DisablePause();
else EnablePause();
}
internal void EnablePause()
@@ -700,12 +689,21 @@ public class CustomGamePlayer : MonoBehaviour
internal void DisablePause()
{
if (CustomGamePlayerPauseMenu.Instance.statsMenu.activeSelf)
{
CustomGamePlayerPauseMenu.Instance.statsMenuExitButton.onClick.Invoke();
return;
}
if (CustomGamePlayerPauseMenu.Instance.editingUI == true)
{
CustomGamePlayerPauseMenu.Instance.ToggleEditingUI();
return;
}
lastMoveTime = Time.time;
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
backgroundMusic.GetComponent<GameMusicHandler>().ResumeMusic();
pausePanel.SetActive(false);
if (CustomGamePlayerPauseMenu.Instance.editingUI == true) CustomGamePlayerPauseMenu.Instance.ToggleEditingUI();
}
void OnApplicationPause(bool pause)