From 7368bc6fff9e2de2b34e3f49ba1a848c56bd8750 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sat, 31 May 2025 16:54:33 -0700 Subject: [PATCH] Optimize text stuff --- Assets/Scripts/GamePlayer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/GamePlayer.cs b/Assets/Scripts/GamePlayer.cs index 39b129d..9d9dfcc 100644 --- a/Assets/Scripts/GamePlayer.cs +++ b/Assets/Scripts/GamePlayer.cs @@ -84,7 +84,7 @@ public class Game : MonoBehaviour PlayerPrefs.Save(); backgroundMusic.volume = PlayerPrefs.GetFloat("musicVolume", 1f); screenWidth = Camera.main.orthographicSize * 2f * Camera.main.aspect; - GameObject.Find("HighScoreText").GetComponent().text = $"High Score: {highscore}"; + highScoreText.text = $"High Score: {highscore}"; if (PlayerPrefs.GetInt("Setting2", 0) == 1) { GameObject leftArrow = new("LeftArrow"); @@ -295,16 +295,16 @@ public class Game : MonoBehaviour if (boostLeft > 0f) { boostLeft -= Time.deltaTime; - boostText.GetComponent().text = "Boost expires in " + $"{boostLeft:0.0}" + "s"; + boostText.text = "Boost expires in " + $"{boostLeft:0.0}" + "s"; } else if (slownessLeft > 0f) { slownessLeft -= Time.deltaTime; - boostText.GetComponent().text = "Slowness expires in " + $"{slownessLeft:0.0}" + "s"; + boostText.text = "Slowness expires in " + $"{slownessLeft:0.0}" + "s"; } else { - boostText.GetComponent().text = ""; + boostText.text = ""; } } }