public void OpenCitizenAcceptionWindow() { Time.timeScale = 0; isBlockOpened[1] = true; buttonsManager.DisableRightMenuButtons(); if (interButtons.Count > 0) { interButtons.Clear(); } interCanvasObshinaAndRaid = -1; foreach (Button button in buttonsManager.gameButtons) { if (button.IsInteractable()) { interButtons.Enqueue(button); } } for (int i = 0; i < 7; i += 3) { if (openingWindows[i].gameObject.activeInHierarchy) //Если включено окно общины, помощника или вылазки { interCanvasObshinaAndRaid = i; } } foreach (Button button in interButtons) { button.interactable = false; } if (interCanvasObshinaAndRaid != -1) { openingWindows[interCanvasObshinaAndRaid].gameObject.SetActive(false); } if (!openingWindows[5].gameObject.activeInHierarchy) { openingWindows[5].gameObject.SetActive(true); } buttonsManager.EnableConfirmButtons(); citizenManager.GetNewCitizen(); }
public void Pause(int check) { if ((Input.GetKeyDown(KeyCode.Escape) || check == 1) && !confirmCanvas.gameObject.activeInHierarchy) { if (!canvas.gameObject.activeInHierarchy) { gameController.dataController.globalData.isPaused = true; if (kickConfirmCanvas.gameObject.activeInHierarchy) { kickConfirmCanvas.gameObject.SetActive(false); } canvas.gameObject.SetActive(true); butManager.DisableButtons(); if (!gameController.IsAnyBlockOpened()) { Time.timeScale = 0; } } else { gameController.dataController.globalData.isPaused = false; canvas.gameObject.SetActive(false); if (!gameController.IsAnyBlockOpened()) { butManager.EnableButtons(); Time.timeScale = 1; } else { butManager.EnableConfirmButtons(); Debug.Log("Enabling"); butManager.EnableRaidButtons(); } } } }