summaryrefslogtreecommitdiff
path: root/Assets/Scripts/PauseMenu.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-12-05 19:52:15 -0500
committerAndrew Lee <alee14498@protonmail.com>2020-12-05 19:52:15 -0500
commiteff38cca28e00a9049ab4817ecac6edc71e9b335 (patch)
tree015fbe90794257d5c534cc6195a1028450e67bdc /Assets/Scripts/PauseMenu.cs
parent0a843187ae6b809f01cc839bf9c51402373dd2c8 (diff)
downloadProject-Sandbox-master.tar.gz
Project-Sandbox-master.tar.bz2
Project-Sandbox-master.zip
Upgraded to Unity 2019.4.16HEADmaster
Diffstat (limited to 'Assets/Scripts/PauseMenu.cs')
-rw-r--r--Assets/Scripts/PauseMenu.cs12
1 files changed, 7 insertions, 5 deletions
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();
}