From eff38cca28e00a9049ab4817ecac6edc71e9b335 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sat, 5 Dec 2020 19:52:15 -0500 Subject: Upgraded to Unity 2019.4.16 --- Assets/Scripts/PauseMenu.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Assets/Scripts/PauseMenu.cs') diff --git a/Assets/Scripts/PauseMenu.cs b/Assets/Scripts/PauseMenu.cs index 284756f..2183c52 100644 --- a/Assets/Scripts/PauseMenu.cs +++ b/Assets/Scripts/PauseMenu.cs @@ -8,18 +8,20 @@ public class PauseMenu : MonoBehaviour public bool lockCursor = true; public GameObject panel; - private int counter; + private int m_counter; // Update is called once per frame - public void showhidePanel() + public void ShowhidePanel() { - counter++; - if (counter % 2 == 1) + m_counter++; + if (m_counter % 2 == 1) { panel.gameObject.SetActive(true); + Time.timeScale = 0; } else { panel.gameObject.SetActive(false); + Time.timeScale = 1; } } @@ -28,7 +30,7 @@ public class PauseMenu : MonoBehaviour if (Input.GetKeyDown(KeyCode.Escape)) { lockCursor = !lockCursor; - showhidePanel(); + ShowhidePanel(); } -- cgit v1.2.3