Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions Assets/Scripts/Pause.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ public class Pause : MonoBehaviour
bool paused;

// Use this for initialization
void Start ()
void Start()
{
OptionsCanvas = GameObject.Find("OptionsCanvas");
imgFade = objFade.GetComponent<Image>();
OptionsCanvas.SetActive(false);
objText.SetActive(false);
objButtons.SetActive(false);
OptionsCanvas.SetActive(false);
}

// Update is called once per frame
void Update ()
void Update()
{
if (!busy && (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.P)))
{
Expand Down Expand Up @@ -52,10 +51,9 @@ IEnumerator _TransitionIn()
imgFade.color = new Color(0, 0, 0, 0.4f);

// Show the PAUSED text and the buttons

objText.SetActive(true);
objButtons.SetActive(true);

OptionsCanvas.SetActive(false);
// Allow input again
busy = false;
}
Expand Down Expand Up @@ -91,24 +89,25 @@ public void Resume()
StartCoroutine(_TransitionOut());
}
}
//Opens up OptionsCanvas, disables the pause menu while the options menu is up
public void Settings()
public void Option()
{
if (!busy)
{
OptionsCanvas.SetActive(true);
busy = true;
objText.SetActive(false);
objButtons.SetActive(false);
OptionsCanvas.SetActive(true);
}
}
//Mapped to exit button for options menu
public void closeSettings()
public void Quit()
{
OptionsCanvas.SetActive(false);
busy = false;
Application.Quit();
}

public void Quit()
//method goes into option canvas to head back to pause menu
public void Back()
{
Application.Quit();
StartCoroutine(_TransitionIn());
}

}
Binary file added Assets/optionPause.unity
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/optionPause.unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.