From 89ed88db3e119f2cb7fedc1c3234702003cd5185 Mon Sep 17 00:00:00 2001 From: HaeinLEE Date: Wed, 14 May 2025 18:04:41 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EB=8F=8C=EB=B0=9C=20=EC=9D=B4=EB=B2=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=8C=A8=EB=84=90=20null=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 씬전환시에도 구독을 해제해주고 있습니다. --- Assets/LIN/Scripts/DailyRoutine/InteractionController.cs | 6 +++++- Assets/Scripts/Common/GameManager.cs | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/LIN/Scripts/DailyRoutine/InteractionController.cs b/Assets/LIN/Scripts/DailyRoutine/InteractionController.cs index ffb408ad..788338ad 100644 --- a/Assets/LIN/Scripts/DailyRoutine/InteractionController.cs +++ b/Assets/LIN/Scripts/DailyRoutine/InteractionController.cs @@ -21,6 +21,11 @@ public class InteractionController : MonoBehaviour PlayerStats.Instance.SetInteractionPanelController(interactionAnimationPanelController); PlayerStats.Instance.SetHousingCanvasController(housingCanvasController); } + + public void ReSetAfterWorkEvent() + { + PlayerStats.Instance.OnWorked -= SuddenAfterWorkEventHappen; + } // 상호작용 가능한 사물 범위에 들어올 때 private void OnTriggerEnter(Collider other) @@ -118,7 +123,6 @@ public class InteractionController : MonoBehaviour // Interaction Controller와 같은 방식으로 작동됩니다. private void SuddenAfterWorkEventHappen() { - PlayerStats.Instance.OnWorked -= SuddenAfterWorkEventHappen; AfterWorkEventType afterWorkEventType = SuddenEventCalculator(); if (afterWorkEventType == AfterWorkEventType.None) return; diff --git a/Assets/Scripts/Common/GameManager.cs b/Assets/Scripts/Common/GameManager.cs index 85bd6035..07ba2b5e 100644 --- a/Assets/Scripts/Common/GameManager.cs +++ b/Assets/Scripts/Common/GameManager.cs @@ -95,6 +95,8 @@ public partial class GameManager : Singleton,ISaveable public void ChangeToGameScene() { tryStageCount++; // 던전 시도 횟수 증가 + InteractionController interactionController = FindObjectOfType(); + interactionController.ReSetAfterWorkEvent(); SceneManager.LoadScene("ReDungeon"); // 던전 Scene HandleSceneAudio("Dungeon"); }