DEG-166 [Fix] null 오류 체크

This commit is contained in:
Sehyeon 2025-05-14 14:26:41 +09:00
parent 2dd70dff2b
commit c0e6264355
2 changed files with 18 additions and 17 deletions

View File

@ -296,11 +296,6 @@ public class PlayerStats : MonoBehaviour
// 하루가 실제로 종료된 경우에만 이벤트 발생 // 하루가 실제로 종료된 경우에만 이벤트 발생
if (isDayEnded) if (isDayEnded)
{ {
// 결근 관련 변수 초기화
_hasWorkedToday = false;
_hasCheckedAbsenceToday = false;
_hasShownBubbleToday = false;
// 식사 횟수 초기화 // 식사 횟수 초기화
_mealCount = 0; _mealCount = 0;
@ -334,6 +329,13 @@ public class PlayerStats : MonoBehaviour
EndDay(time, actionType); EndDay(time, actionType);
} }
if (TimeStat >= 8.0f && TimeStat < 9.0f)
{
_hasWorkedToday = false;
_hasCheckedAbsenceToday = false;
_hasShownBubbleToday = false;
}
CheckBubble(); CheckBubble();
} }

View File

@ -43,17 +43,20 @@ public partial class GameManager : Singleton<GameManager>
public void StartNPCDialogue(GamePhase phase) // intro, gameplay, end 존재 public void StartNPCDialogue(GamePhase phase) // intro, gameplay, end 존재
{ {
if(chatWindowController == null) StartCoroutine(StartNPCDialogueCoroutine(phase));
SetChatWindowController();
chatWindowController.SetGamePhase(phase);
} }
private void SetChatWindowController() private IEnumerator StartNPCDialogueCoroutine(GamePhase phase)
{ {
if (chatWindowController == null)
{
yield return new WaitForSeconds(0.5f); // 씬 전환 대기
chatWindowController = FindObjectOfType<ChatWindowController>(); chatWindowController = FindObjectOfType<ChatWindowController>();
} }
chatWindowController.SetGamePhase(phase);
}
#endregion #endregion
//일시 정지 //일시 정지
@ -90,13 +93,9 @@ public partial class GameManager : Singleton<GameManager>
public void ChangeToHomeScene() public void ChangeToHomeScene()
{ {
SceneManager.LoadScene("ReHousing"); // Home Scene SceneManager.LoadScene("ReHousing"); // Home Scene
if (tryStageCount >= 3) // 엔딩
{
FailEnd();
}
HandleSceneAudio("Housing"); HandleSceneAudio("Housing");
if (tryStageCount >= 3) FailEnd(); // 엔딩
} }
// TODO: Open Setting Panel 등 Panel 처리 // TODO: Open Setting Panel 등 Panel 처리