Commit fb7017c5 authored by Ashley's avatar Ashley

changed pause function

parent e9702593
......@@ -4,22 +4,31 @@ using UnityEngine;
public class GameManager : SingletonBehaviour<GameManager>
{
private bool isPaused;
private bool _isPaused;
//Manages game state. Pause, death, win, and changing levels.
public void Pause()
public bool isPaused
{
if(isPaused)
get
{
//set timescale back to normal
isPaused = false;
Debug.Log("Game is unpaused");
return _isPaused;
}
else
set
{
//set timescale to zero
isPaused = true;
Debug.Log("Game is paused");
_isPaused = value;
if (isPaused)
{
//set timescale back to normal
isPaused = false;
Debug.Log("Game is unpaused");
}
else
{
//set timescale to zero
isPaused = true;
Debug.Log("Game is paused");
}
}
}
public void Death()
......@@ -30,14 +39,8 @@ public class GameManager : SingletonBehaviour<GameManager>
{
Debug.Log("You won!");
}
public void changeLevel()
public void ChangeLevel()
{
Debug.Log("Changing level state");
}
public bool getPause()
{
return isPaused;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment