From bde369c489a19362b30b3c65b5030da6d0a5f387 Mon Sep 17 00:00:00 2001 From: averrous <averous009@gmail.com> Date: Sat, 15 Apr 2023 12:59:31 +0700 Subject: [PATCH] fix: toast and reset test parameter --- Assets/Scripts/Managers/EnemyManager.cs | 2 +- Assets/Scripts/Managers/SettingManager.cs | 1 - Assets/Scripts/Managers/ToastManager.cs | 5 +++++ Assets/Scripts/Quest/Temple/Temple.cs | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Managers/EnemyManager.cs b/Assets/Scripts/Managers/EnemyManager.cs index a0c4f5e..ef789d1 100644 --- a/Assets/Scripts/Managers/EnemyManager.cs +++ b/Assets/Scripts/Managers/EnemyManager.cs @@ -51,7 +51,7 @@ public class EnemyManager : MonoBehaviour { count++; // fill count with last quest - if (count == 1) isBoss = true; + if (count == 4) isBoss = true; Debug.Log("Turn on " + nameof(this.Spawn)); InvokeRepeating(nameof(this.Spawn), spawnTime, spawnTime); } diff --git a/Assets/Scripts/Managers/SettingManager.cs b/Assets/Scripts/Managers/SettingManager.cs index 22700ce..acf3fe2 100644 --- a/Assets/Scripts/Managers/SettingManager.cs +++ b/Assets/Scripts/Managers/SettingManager.cs @@ -26,7 +26,6 @@ public class SettingManager : MonoBehaviour Debug.Log("VOLUME: " + GlobalManager.Instance.Volume); if (Input.GetKeyDown(KeyCode.Escape)) { - Debug.Log("CLOSINGGGGGGGGG"); Close(); } } diff --git a/Assets/Scripts/Managers/ToastManager.cs b/Assets/Scripts/Managers/ToastManager.cs index fab595b..b91bdaa 100644 --- a/Assets/Scripts/Managers/ToastManager.cs +++ b/Assets/Scripts/Managers/ToastManager.cs @@ -42,6 +42,11 @@ class ToastManager : MonoBehaviour public void ShowToast(string text, int duration) + { + StartCoroutine(showToastCOR(text, duration)); + } + + public void ShowToastQueue(string text, int duration) { //StartCoroutine(showToastCOR(text, duration)); toasts.Enqueue((text, duration)); diff --git a/Assets/Scripts/Quest/Temple/Temple.cs b/Assets/Scripts/Quest/Temple/Temple.cs index babf0c4..afbc03c 100644 --- a/Assets/Scripts/Quest/Temple/Temple.cs +++ b/Assets/Scripts/Quest/Temple/Temple.cs @@ -83,17 +83,17 @@ public class Temple : MonoBehaviour } idxCurrentQuest++; - ToastManager.Instance.ShowToast("Quest " + idxCurrentQuest + " is Completed!", 1); + ToastManager.Instance.ShowToastQueue("Quest " + idxCurrentQuest + " is Completed!", 1); // retrieve the time // add it to the global time // remove the timer var questTime = timer.TakeTime(); - ToastManager.Instance.ShowToast("Your total time now: " + ToastManager.Instance.ShowToastQueue("Your total time now: " + System.TimeSpan.FromSeconds(GlobalManager.Instance.TotalTime).ToString("mm':'ss") + " + " + System.TimeSpan.FromSeconds(questTime).ToString("mm':'ss"), 1); GlobalManager.Instance.TotalTime += questTime; - ToastManager.Instance.ShowToast(System.TimeSpan.FromSeconds(GlobalManager.Instance.TotalTime).ToString("mm':'ss"), 1); + ToastManager.Instance.ShowToastQueue(System.TimeSpan.FromSeconds(GlobalManager.Instance.TotalTime).ToString("mm':'ss"), 1); } private void OnTriggerEnter(Collider other) -- GitLab