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()