Skip to content
Snippets Groups Projects
Commit ec9dfb4e authored by haziqam's avatar haziqam
Browse files

fix: save behaviour key press

parent 23b6ad77
Branches
Tags
No related merge requests found
...@@ -5,15 +5,12 @@ using UnityEngine; ...@@ -5,15 +5,12 @@ using UnityEngine;
public class PauseBehaviour : MonoBehaviour public class PauseBehaviour : MonoBehaviour
{ {
public GameObject PauseUICanvas; public GameObject PauseUICanvas;
//public GunSystem gunSystem;
//GameObject[] weapons;
FPSController fpsController; FPSController fpsController;
// Start is called before the first frame update // Start is called before the first frame update
void OnEnable() void OnEnable()
{ {
fpsController = GetComponent<FPSController>(); fpsController = GetComponent<FPSController>();
//weapons = GameObject.FindGameObjectsWithTag("Weapon");
} }
// Update is called once per frame // Update is called once per frame
...@@ -21,17 +18,6 @@ public class PauseBehaviour : MonoBehaviour ...@@ -21,17 +18,6 @@ public class PauseBehaviour : MonoBehaviour
{ {
if (Input.GetKeyDown(KeyCode.Escape)) if (Input.GetKeyDown(KeyCode.Escape))
{ {
//PauseUICanvas.SetActive(!PauseUICanvas.activeSelf);
//bool isPauseUIActive = PauseUICanvas.activeSelf;
//if (isPauseUIActive)
//{
// HandleOpen();
//}
//else
//{
// HandleClose();
//}
bool isPauseUIActive = PauseUICanvas.activeSelf; bool isPauseUIActive = PauseUICanvas.activeSelf;
if (!isPauseUIActive) if (!isPauseUIActive)
{ {
...@@ -50,7 +36,6 @@ public class PauseBehaviour : MonoBehaviour ...@@ -50,7 +36,6 @@ public class PauseBehaviour : MonoBehaviour
Cursor.visible = false; Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked; Cursor.lockState = CursorLockMode.Locked;
enablePlayerGunSystems(); enablePlayerGunSystems();
// gunSystem.enabled = true;
Time.timeScale = 1.0f; Time.timeScale = 1.0f;
fpsController.enabled = true; fpsController.enabled = true;
} }
...@@ -60,7 +45,6 @@ public class PauseBehaviour : MonoBehaviour ...@@ -60,7 +45,6 @@ public class PauseBehaviour : MonoBehaviour
Cursor.visible = true; Cursor.visible = true;
Cursor.lockState = CursorLockMode.None; Cursor.lockState = CursorLockMode.None;
disablePlayerGunSystems(); disablePlayerGunSystems();
// gunSystem.enabled = false;
Time.timeScale = 0.0f; Time.timeScale = 0.0f;
fpsController.enabled = false; fpsController.enabled = false;
} }
...@@ -68,28 +52,11 @@ public class PauseBehaviour : MonoBehaviour ...@@ -68,28 +52,11 @@ public class PauseBehaviour : MonoBehaviour
private void enablePlayerGunSystems() private void enablePlayerGunSystems()
{ {
GunSystem.IsGamePaused = false; GunSystem.IsGamePaused = false;
//int playerLayer = LayerMask.NameToLayer("Player");
//foreach (GameObject weapon in weapons)
//{
// if (weapon.layer == playerLayer)
// {
// GunSystem gunSystem = weapon.GetComponent<GunSystem>();
// gunSystem.enabled = true;
// }
//}
} }
private void disablePlayerGunSystems() private void disablePlayerGunSystems()
{ {
GunSystem.IsGamePaused = true; GunSystem.IsGamePaused = true;
//int playerLayer = LayerMask.NameToLayer("Player");
//foreach (GameObject weapon in weapons)
//{
// if (weapon.layer == playerLayer)
// {
// GunSystem gunSystem = weapon.GetComponent<GunSystem>();
// gunSystem.enabled = false;
// }
//}
} }
} }
...@@ -38,12 +38,6 @@ public class SaveBehaviour : MonoBehaviour ...@@ -38,12 +38,6 @@ public class SaveBehaviour : MonoBehaviour
SaveMenuCanvas.SetActive(true); SaveMenuCanvas.SetActive(true);
} }
} }
else
{
pauseBehaviour.HandleClose();
SaveMenuCanvas.SetActive(false);
}
} }
} }
} }
......
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