Skip to content

Commit

Permalink
Added ability to enable/disable pausing (as part of #433); not wired …
Browse files Browse the repository at this point in the history
…up to anything
  • Loading branch information
jerry411 committed Apr 20, 2020
1 parent d699e7f commit 6b93ac1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/LDJam46/Assets/Scripts/UI/PauseMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class PauseMenu : MonoBehaviour
[SerializeField] private GameObject controlsPanel;
[SerializeField] private Selectable firstSelectable;

private bool _enablePausing = true;

void Start()
{
overlay.SetActive(false);
Expand All @@ -19,7 +21,7 @@ void Start()

void Update()
{
if (Input.GetButtonDown("Pause") || Input.GetKeyDown(KeyCode.Escape))
if ((Input.GetButtonDown("Pause") || Input.GetKeyDown(KeyCode.Escape)) && _enablePausing)
{
if (overlay.activeSelf)
{
Expand Down Expand Up @@ -77,4 +79,9 @@ public void ToggleControlsPanel()
optionsPanel.SetActive(false);
}
}

public void EnablePausing(bool enable)
{
_enablePausing = enable;
}
}

0 comments on commit 6b93ac1

Please sign in to comment.