diff --git a/Assets/KSH/PlayerStats.cs b/Assets/KSH/PlayerStats.cs index 435a86eb..3f23bcb1 100644 --- a/Assets/KSH/PlayerStats.cs +++ b/Assets/KSH/PlayerStats.cs @@ -296,11 +296,6 @@ public class PlayerStats : MonoBehaviour // 하루가 실제로 종료된 경우에만 이벤트 발생 if (isDayEnded) { - // 결근 관련 변수 초기화 - _hasWorkedToday = false; - _hasCheckedAbsenceToday = false; - _hasShownBubbleToday = false; - // 식사 횟수 초기화 _mealCount = 0; @@ -333,6 +328,13 @@ public class PlayerStats : MonoBehaviour { EndDay(time, actionType); } + + if (TimeStat >= 8.0f && TimeStat < 9.0f) + { + _hasWorkedToday = false; + _hasCheckedAbsenceToday = false; + _hasShownBubbleToday = false; + } CheckBubble(); } diff --git a/Assets/Scripts/Common/GameManager.cs b/Assets/Scripts/Common/GameManager.cs index f87bffd2..9cd6e33f 100644 --- a/Assets/Scripts/Common/GameManager.cs +++ b/Assets/Scripts/Common/GameManager.cs @@ -43,15 +43,18 @@ public partial class GameManager : Singleton public void StartNPCDialogue(GamePhase phase) // intro, gameplay, end 존재 { - if(chatWindowController == null) - SetChatWindowController(); - - chatWindowController.SetGamePhase(phase); + StartCoroutine(StartNPCDialogueCoroutine(phase)); } - private void SetChatWindowController() + private IEnumerator StartNPCDialogueCoroutine(GamePhase phase) { - chatWindowController = FindObjectOfType(); + if (chatWindowController == null) + { + yield return new WaitForSeconds(0.5f); // 씬 전환 대기 + chatWindowController = FindObjectOfType(); + } + + chatWindowController.SetGamePhase(phase); } #endregion @@ -90,13 +93,9 @@ public partial class GameManager : Singleton public void ChangeToHomeScene() { SceneManager.LoadScene("ReHousing"); // Home Scene - - if (tryStageCount >= 3) // 엔딩 - { - FailEnd(); - } - HandleSceneAudio("Housing"); + + if (tryStageCount >= 3) FailEnd(); // 엔딩 } // TODO: Open Setting Panel 등 Panel 처리