Now preventing pause from being opened in camera zoom-in.
This commit is contained in:
parent
2919692ed4
commit
90144e086f
2 changed files with 25 additions and 5 deletions
|
@ -42,6 +42,9 @@ public class GuardController : Photon.PunBehaviour {
|
|||
{
|
||||
guardCamera.DisablePreviewMode();
|
||||
}
|
||||
|
||||
// Prevent the pause menu from appearing.
|
||||
InGameMenuController.MenuBlocked = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,6 +68,9 @@ public class GuardController : Photon.PunBehaviour {
|
|||
{
|
||||
mCameras[i].EnablePreviewMode(size, i % z, i / z);
|
||||
}
|
||||
|
||||
// Allow the pause menu to appear.
|
||||
InGameMenuController.MenuBlocked = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,18 +4,32 @@ using UnityEngine;
|
|||
|
||||
public class InGameMenuController : MonoBehaviour {
|
||||
|
||||
public static bool MenuBlocked { get; set; }
|
||||
|
||||
public GameObject inGameMenu;
|
||||
|
||||
void Update () {
|
||||
if (Input.GetKeyDown (KeyCode.Escape ))
|
||||
EscapePressed();
|
||||
private void Start() {
|
||||
MenuBlocked = false;
|
||||
}
|
||||
|
||||
void Update() {
|
||||
if (MenuBlocked) {
|
||||
return;
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.Escape)) {
|
||||
EscapePressed();
|
||||
}
|
||||
}
|
||||
|
||||
void EscapePressed() {
|
||||
inGameMenu.SetActive (true);
|
||||
if (inGameMenu.GetActive()) {
|
||||
Resume();
|
||||
} else {
|
||||
inGameMenu.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void Resume() {
|
||||
inGameMenu.SetActive (false);
|
||||
inGameMenu.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue