diff --git a/Assets/Scripts/SpellingBeeController.cs b/Assets/Scripts/SpellingBeeController.cs index c449723..5287ded 100644 --- a/Assets/Scripts/SpellingBeeController.cs +++ b/Assets/Scripts/SpellingBeeController.cs @@ -57,8 +57,7 @@ public class SpellingBeeController : MonoBehaviour { timerValue -= Time.deltaTime; - if (timerValue <= 0.0f) - { + if (timerValue <= 0.0f) { timerValue = 0.0f; // Handle end of timer } @@ -69,6 +68,7 @@ public class SpellingBeeController : MonoBehaviour { timerText.text = string.Format("{0:00}:{1:00}", minutes, seconds); } + // Check if the correct char has been given as input void checkChar(char letter) { if (Char.ToUpper(letter) == Char.ToUpper(currentWord[currentIndex]) && input.text.Length == 1) { letters[currentIndex].GetComponent().color = Color.green; @@ -86,10 +86,12 @@ public class SpellingBeeController : MonoBehaviour { } } + // Adds seconds to timer void addSeconds(int seconds) { timerValue += (float) seconds; } + // Find the chosen theme by its name Theme findThemeByName(string themeName) { int themeIndex = 0; diff --git a/Assets/Scripts/Timer.cs b/Assets/Scripts/Timer.cs deleted file mode 100644 index a3ab29d..0000000 --- a/Assets/Scripts/Timer.cs +++ /dev/null @@ -1,34 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; - -public class Timer : MonoBehaviour -{ - private float timerValue; - public Text timerText; - - void Start() - { - timerValue = 0.0f; - timerText = GetComponent(); - } - - void Update() - { - timerValue -= Time.deltaTime; - - if (timerValue <= 0.0f) - { - timerValue = 0.0f; - // Handle end of timer - } - - int minutes = Mathf.FloorToInt(timerValue / 60.0f); - int seconds = Mathf.FloorToInt(timerValue % 60.0f); - - timerText.text = string.Format("{0:00}:{1:00}", minutes, seconds); - } - - void addSeconds(int seconds) { - timerValue += (float) seconds; - } -} diff --git a/Assets/Scripts/Timer.cs.meta b/Assets/Scripts/Timer.cs.meta deleted file mode 100644 index 09d995e..0000000 --- a/Assets/Scripts/Timer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 531e5c20048e1923fa3ed13005bd4a0b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: