From 49ca624fa5606616aaa76ef1de123d5a7484ddbb Mon Sep 17 00:00:00 2001 From: "aube.lee" Date: Thu, 27 Feb 2025 00:57:48 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B2=8C=EC=9E=84=20=EC=9D=BC=EC=8B=9C?= =?UTF-8?q?=EC=A0=95=EC=A7=80=20=EC=A4=91=EC=97=90=EB=8F=84=20=ED=95=98?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=A9=EC=A0=84=20=EC=8B=9C=EA=B0=84=20=ED=9D=98?= =?UTF-8?q?=EB=9F=AC=EA=B0=88=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Prefabs/Heart/Heart Controller.prefab | 2 +- .../Scripts/Character/Heart/HeartSystem.cs | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Heart/Heart Controller.prefab b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Heart/Heart Controller.prefab index ad944b26..dbc09bef 100644 --- a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Heart/Heart Controller.prefab +++ b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Heart/Heart Controller.prefab @@ -238,7 +238,7 @@ MonoBehaviour: m_text: + 0 m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 3116464c7616674448f2fb05b50bf91b, type: 2} - m_sharedMaterial: {fileID: -5364670637895760327, guid: 3116464c7616674448f2fb05b50bf91b, type: 2} + m_sharedMaterial: {fileID: 0} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] diff --git a/Gameton-06/Assets/Gameton/Scripts/Character/Heart/HeartSystem.cs b/Gameton-06/Assets/Gameton/Scripts/Character/Heart/HeartSystem.cs index 8d505053..1cc32a4f 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Character/Heart/HeartSystem.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Character/Heart/HeartSystem.cs @@ -15,15 +15,26 @@ namespace TON public TextMeshProUGUI timerText; // 하트 충전 타이머 UI public GameObject overHeartText; // 하트 충전 타이머 UI + private float lastUpdateTime; private void OnEnable() { + lastUpdateTime = Time.realtimeSinceStartup; UpdateHeartUI(); // 시작 시 UI 갱신 } - private void FixedUpdate() + private void Update() { - UpdateTimer(); + // 실제 시간 기반으로 일정 간격마다 업데이트 (Time.Scale = 0 에 영향받지 않도록) + float currentTime = Time.realtimeSinceStartup; + float deltaTime = currentTime - lastUpdateTime; + + // 1초마다 타이머 업데이트 (더 짧은 간격으로 설정 가능) + if (deltaTime >= 1.0f) + { + UpdateTimer(); + lastUpdateTime = currentTime; + } } public void UpdateHeartUI()