Commit 24be0262 authored by Luke Smith's avatar Luke Smith

Merge with master

parents 7c898873 ad969e4a
This diff is collapsed.
fileFormatVersion: 2
guid: 4b32869774338904a875250168c72931
timeCreated: 1492129663
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -12,12 +12,18 @@ public class GameManager : SingletonBehaviour<GameManager>
private float _levelTimer;
private Text timerText;
private GameObject birb;
public GameObject pauseMenu;
void Awake()
{
birb = GameObject.FindGameObjectWithTag("Player");
DontDestroyOnLoad(this);
//isPaused = true;
}
void Start()
{
birb = GameObject.FindGameObjectWithTag("Player");
pauseMenu = GameObject.FindGameObjectWithTag("PauseMenu");
pauseMenu.SetActive(false);
}
......@@ -33,12 +39,14 @@ public class GameManager : SingletonBehaviour<GameManager>
{
//set timescale back to normal
Time.timeScale = 1;
GameManager.instance.pauseMenu.SetActive(false);
Debug.Log("Game is unpaused");
}
else
else if(!isPaused)
{
//set timescale to zero
Time.timeScale = 0;
GameManager.instance.pauseMenu.SetActive(true);
Debug.Log("Game is paused");
}
_isPaused = value;
......@@ -88,8 +96,25 @@ public class GameManager : SingletonBehaviour<GameManager>
if (!timerText) {
timerText = GameObject.FindGameObjectWithTag("Timer").GetComponent<Text>();
}
if(!GameManager.instance.pauseMenu)
{
GameManager.instance.pauseMenu = GameObject.FindGameObjectWithTag("PauseMenu");
}
string currentTime = formatTime(Time.time - levelTimer);
timerText.text = "Time: " + currentTime;
if(Input.GetButtonDown("Cancel"))
{
if(GameManager.instance.pauseMenu.activeSelf == true)
{
isPaused = false;
GameManager.instance.pauseMenu.SetActive(false);
}
else
{
isPaused = true;
GameManager.instance.pauseMenu.SetActive(true);
}
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PauseMenu : MonoBehaviour {
public void Resume()
{
Time.timeScale = 1;
GameManager.instance.isPaused = false;
this.gameObject.SetActive(false);
}
public void QuitGame()
{
SceneManager.LoadScene("MainMenu");
this.gameObject.SetActive(false);
}
}
fileFormatVersion: 2
guid: 5096d6a3a4f1fcd4cafbc2fbafbfb0d1
timeCreated: 1492127986
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
m_EditorVersion: 5.5.0f3
m_EditorVersion: 5.5.1f1
......@@ -10,6 +10,7 @@ TagManager:
- Tiles Parent
- slowHazard
- Timer
- PauseMenu
layers:
- Default
- TransparentFX
......

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Birb", "Assembly-CSharp.csproj", "{A490B848-188F-485C-9203-EFF824787523}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Birb.Editor", "Birb.Editor.csproj", "{F95D23E3-7F70-C6FA-BC18-9962825299F2}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2015
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "birb.CSharp", "birb.CSharp.csproj", "{40340304-79A9-6623-4DE1-B2CE709C92DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -11,26 +9,12 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
<<<<<<< Updated upstream
{A490B848-188F-485C-9203-EFF824787523}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A490B848-188F-485C-9203-EFF824787523}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A490B848-188F-485C-9203-EFF824787523}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A490B848-188F-485C-9203-EFF824787523}.Release|Any CPU.Build.0 = Release|Any CPU
=======
{0E1C9E80-2222-A473-1DED-289BBAAF06DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E1C9E80-2222-A473-1DED-289BBAAF06DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E1C9E80-2222-A473-1DED-289BBAAF06DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E1C9E80-2222-A473-1DED-289BBAAF06DC}.Release|Any CPU.Build.0 = Release|Any CPU
{F95D23E3-7F70-C6FA-BC18-9962825299F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F95D23E3-7F70-C6FA-BC18-9962825299F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F95D23E3-7F70-C6FA-BC18-9962825299F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F95D23E3-7F70-C6FA-BC18-9962825299F2}.Release|Any CPU.Build.0 = Release|Any CPU
>>>>>>> Stashed changes
{40340304-79A9-6623-4DE1-B2CE709C92DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40340304-79A9-6623-4DE1-B2CE709C92DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40340304-79A9-6623-4DE1-B2CE709C92DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40340304-79A9-6623-4DE1-B2CE709C92DF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Assembly-CSharp.csproj
EndGlobalSection
EndGlobal
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