From f9db9ee2c26fdd90f8af17c9d1cf0c889df8e556 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Thu, 13 Mar 2025 12:47:46 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9B=A8=EC=9D=B4=EB=B8=8C=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=A1=B0=EA=B1=B4=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Gameton/Scripts/UI/IngameUI.cs | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs b/Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs index 005a1a57..a96ccb07 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs @@ -28,7 +28,6 @@ namespace TON [SerializeField] private CharacterBase character; - private void OnEnable() { character = GameObject.Find("TON.Player").GetComponentInChildren(); @@ -71,21 +70,18 @@ namespace TON private void UpdatePlayTimeDisplay() { - if (_monsterSpawner != null && !_monsterSpawner.isTimerRunning) + float playTime = StageManager.Singleton.PlayTime; + + int minutes = Mathf.FloorToInt(playTime / 60f); + int seconds = Mathf.FloorToInt(playTime % 60f); + + // 시간이 변경된 경우에만 문자열 생성 + if (minutes != lastMinutes || seconds != lastSeconds) { - float playTime = StageManager.Singleton.PlayTime - ((StageManager.Singleton.waveCount + 1) * 5); - - int minutes = Mathf.FloorToInt(playTime / 60f); - int seconds = Mathf.FloorToInt(playTime % 60f); - - // 시간이 변경된 경우에만 문자열 생성 - if (minutes != lastMinutes || seconds != lastSeconds) - { - lastMinutes = minutes; - lastSeconds = seconds; - cachedTimeString = $"time {minutes:00}:{seconds:00}"; - playTimeText.text = cachedTimeString; - } + lastMinutes = minutes; + lastSeconds = seconds; + cachedTimeString = $"time {minutes:00}:{seconds:00}"; + playTimeText.text = cachedTimeString; } }