From ea11523f490d73b71a874f6f2ac1bad9d67ae583 Mon Sep 17 00:00:00 2001 From: mikeleo03 <leonmichael463@gmail.com> Date: Mon, 6 May 2024 10:00:41 +0700 Subject: [PATCH] feat : handle cut-scene handler before scene starts --- Assets/Scripts/Managers/DialogueManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Managers/DialogueManager.cs b/Assets/Scripts/Managers/DialogueManager.cs index 7a7f975..564b5e5 100644 --- a/Assets/Scripts/Managers/DialogueManager.cs +++ b/Assets/Scripts/Managers/DialogueManager.cs @@ -16,6 +16,7 @@ public class DialogueManager : MonoBehaviour // Start is called before the first frame update void Start() { + Time.timeScale = 0; textComponent.text = string.Empty; talkerComponent.text = string.Empty; StartDialogue(); @@ -51,7 +52,7 @@ public class DialogueManager : MonoBehaviour foreach (char c in lines[index].ToCharArray()) { textComponent.text += c; - yield return new WaitForSeconds(textSpeed); + yield return new WaitForSecondsRealtime(textSpeed); } } @@ -67,6 +68,7 @@ public class DialogueManager : MonoBehaviour else { gameObject.SetActive(false); + Time.timeScale = 1; } } } \ No newline at end of file -- GitLab