Commit b282eefb authored by Ashley's avatar Ashley

fixed pause menu

parent 66065f04
......@@ -117,11 +117,11 @@ GameObject:
- component: {fileID: 114044092705028698}
m_Layer: 5
m_Name: PauseMenu
m_TagString: Untagged
m_TagString: PauseMenu
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!114 &114007429724219852
MonoBehaviour:
m_ObjectHideFlags: 1
......
......@@ -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
......
......@@ -16,9 +16,15 @@ public class GameManager : SingletonBehaviour<GameManager>
void Awake()
{
birb = GameObject.FindGameObjectWithTag("Player");
DontDestroyOnLoad(this);
}
void Start()
{
birb = GameObject.FindGameObjectWithTag("Player");
pauseMenu = GameObject.FindGameObjectWithTag("PauseMenu");
pauseMenu.SetActive(false);
}
public bool isPaused
......@@ -33,14 +39,14 @@ public class GameManager : SingletonBehaviour<GameManager>
{
//set timescale back to normal
Time.timeScale = 1;
pauseMenu.SetActive(false);
GameManager.instance.pauseMenu.SetActive(false);
Debug.Log("Game is unpaused");
}
else if(!isPaused)
{
//set timescale to zero
Time.timeScale = 0;
pauseMenu.SetActive(true);
GameManager.instance.pauseMenu.SetActive(true);
Debug.Log("Game is paused");
}
_isPaused = value;
......@@ -90,19 +96,23 @@ 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(pauseMenu.active == true)
if(GameManager.instance.pauseMenu.activeSelf == true)
{
isPaused = false;
pauseMenu.active = false;
GameManager.instance.pauseMenu.SetActive(false);
}
else
{
isPaused = true;
pauseMenu.active = true;
GameManager.instance.pauseMenu.SetActive(true);
}
}
}
......
......@@ -10,6 +10,7 @@ TagManager:
- Tiles Parent
- slowHazard
- Timer
- PauseMenu
layers:
- Default
- TransparentFX
......
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