public void ToggleUI() { if (Camera_Mirage.Instance().GetCamState()) { Camera_Mirage.Instance().TogglePostProc(); } ui.gameObject.SetActive(!ui.gameObject.activeSelf); //Camera.main.cullingMask ^= layerUI; if (ui.gameObject.activeSelf) { AudioManager.PlaySound("book"); layerTemp = Camera.main.cullingMask; Camera.main.cullingMask = layerUI; Time.timeScale = 0; } else { Camera.main.cullingMask = layerTemp; Time.timeScale = 1; } if (VisualItemIsVisible()) { VisualItemToggle(0); } }
public void ToggleBook() { isActive = !isActive; book.SetActive(isActive); if (Camera_Mirage.Instance().GetCamState()) { Camera_Mirage.Instance().TogglePostProc(); } Cursor.visible = isActive; if (isActive) { layerTemp = Camera.main.cullingMask; Camera.main.cullingMask = layerUI; Time.timeScale = 0; Cursor.lockState = CursorLockMode.None; } else { Camera.main.cullingMask = layerTemp; Time.timeScale = 1; Cursor.lockState = CursorLockMode.Locked; } if (UIPhoto.isUIDisplayed()) { UIPhoto.LoadPhotos(UIPhoto.GetCurrentPage()); UIPhoto.ChangePage(0); } }