public void HandleDialogueText(TextAsset text) { DetachCamera.Detach(); GetComponent <CanvasGroup>().ChangeCanvasGroupVisibility(true); LoadFile(text); handlingText = StartCoroutine(_HandleDialogueText(text)); Next(); }
void Update() { if (FindObjectOfType <ActivateMenu>().isPaused == false) { if (Input.GetKeyDown(KeyCode.Tab)) { if (journalActive) { DialogueController.lockDialogue = false; DetachCamera.Reattach(); JournalCanvas.ChangeCanvasGroupVisibility(false); journalActive = false; if (DialogueController.instance.HandlingText == false) { Cursor.lockState = prevLock; Cursor.visible = prevCursorVisible; } sound.PlayOneShot(hideSound); } else { DialogueController.lockDialogue = true; DetachCamera.Detach(); JournalCanvas.ChangeCanvasGroupVisibility(true); journalActive = true; prevLock = Cursor.lockState; prevCursorVisible = Cursor.visible; Cursor.lockState = CursorLockMode.None; Cursor.visible = true; sound.PlayOneShot(showSound); } } } //if (journalActive) //{ // Cursor.lockState = CursorLockMode.None; // Cursor.visible = true; //} //else //{ // Cursor.lockState = CursorLockMode.Locked; // Cursor.visible = false; //} }
public void Pause() { Menu.SetActive(true); isPaused = true; DetachCamera.Detach(); prevCursorVisible = Cursor.visible; prevLock = Cursor.lockState; Cursor.visible = true; Cursor.lockState = CursorLockMode.None; journalAlpha = journalCanvasGroup.alpha; dialogueAlpha = dialogueCanvasGroup.alpha; dialogueCanvasGroup.alpha = 0; journalCanvasGroup.alpha = 0; DialogueController.lockDialogue = true; }