Commit ad969e4a authored by Andrew R Van Buren's avatar Andrew R Van Buren

Merge branch 'pauseMenu' into 'master'

Pause menu

See merge request !65
parents 09f5b4bc b282eefb
This diff is collapsed.
fileFormatVersion: 2
guid: 4b32869774338904a875250168c72931
timeCreated: 1492129663
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
......@@ -1503,6 +1503,106 @@ Transform:
m_PrefabParentObject: {fileID: 4854154196249452, guid: ba720387896779247b89aad1c0b34f7a,
type: 2}
m_PrefabInternal: {fileID: 656324683}
--- !u!1001 &670422024
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1118525862}
m_Modifications:
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_AnchoredPosition.x
value: -0.000061035156
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_SizeDelta.x
value: 400
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_SizeDelta.y
value: 256
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 4b32869774338904a875250168c72931, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &672233107
Prefab:
m_ObjectHideFlags: 0
......@@ -2076,7 +2176,7 @@ ParticleSystem:
m_GameObject: {fileID: 920148520}
serializedVersion: 5
lengthInSec: 0.1
speed: 1
simulationSpeed: 1
looping: 1
prewarm: 0
playOnAwake: 1
......@@ -5328,6 +5428,7 @@ RectTransform:
m_Children:
- {fileID: 1670713437}
- {fileID: 1737786060}
- {fileID: 1969649541}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -6967,6 +7068,11 @@ Prefab:
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 1151e628647482a439ec7203b401bb17, type: 2}
m_IsPrefabParent: 0
--- !u!224 &1969649541 stripped
RectTransform:
m_PrefabParentObject: {fileID: 224641396611505108, guid: 4b32869774338904a875250168c72931,
type: 2}
m_PrefabInternal: {fileID: 670422024}
--- !u!1001 &1981856129
Prefab:
m_ObjectHideFlags: 0
......@@ -7259,7 +7365,7 @@ ParticleSystem:
m_GameObject: {fileID: 2100709141}
serializedVersion: 5
lengthInSec: 0.1
speed: 1
simulationSpeed: 1
looping: 0
prewarm: 0
playOnAwake: 1
......
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}"
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
......@@ -9,15 +9,12 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{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
{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