From ccf80a8ecd7c0cfc5b8c4b2f69c19d63db4a4de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9A=B0=EC=97=B0?= Date: Thu, 31 Oct 2024 23:18:44 +0900 Subject: [PATCH] Rollback: SceneTransform --- Assets/Scripts/Runtime/CH1/Pacmom/PMEnding.cs | 2 +- Assets/Scripts/Runtime/ETC/SceneTransform.cs | 15 +++++++++------ .../Runtime/Middle/ConnectionController.cs | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/Runtime/CH1/Pacmom/PMEnding.cs b/Assets/Scripts/Runtime/CH1/Pacmom/PMEnding.cs index 8e496ff7..4a5b180e 100644 --- a/Assets/Scripts/Runtime/CH1/Pacmom/PMEnding.cs +++ b/Assets/Scripts/Runtime/CH1/Pacmom/PMEnding.cs @@ -89,7 +89,7 @@ public void ExitPacmom() _postProcessing.gameObject.SetActive(false); _sceneTransform = FindObjectOfType(); - _sceneTransform.EscapeFromScene("CH1"); + _sceneTransform.EscapeFromScene("CH1", true); } } } \ No newline at end of file diff --git a/Assets/Scripts/Runtime/ETC/SceneTransform.cs b/Assets/Scripts/Runtime/ETC/SceneTransform.cs index e2c05a72..4aa90a5b 100644 --- a/Assets/Scripts/Runtime/ETC/SceneTransform.cs +++ b/Assets/Scripts/Runtime/ETC/SceneTransform.cs @@ -27,15 +27,15 @@ private void Awake() DontDestroyOnLoad(gameObject); } - public void ConnectToScene(string targetScene) + public void ConnectToScene(string targetScene, bool disablePlayerInput = false) { // 함수 호출 전 효과음 출력, 인풋 막기 필요 _middleScene = _connectionScene; _targetScene = targetScene; - StartCoroutine(nameof(TranslateScene)); + StartCoroutine(nameof(TranslateScene), disablePlayerInput); } - public void EscapeFromScene(string targetScene) + public void EscapeFromScene(string targetScene, bool disablePlayerInput = false) { Managers.Data.InGameKeyBinder.PlayerInputDisable(); @@ -43,10 +43,10 @@ public void EscapeFromScene(string targetScene) _middleScene = _escapeScene; _targetScene = targetScene; - StartCoroutine(nameof(TranslateScene)); + StartCoroutine(nameof(TranslateScene), disablePlayerInput); } - private IEnumerator TranslateScene() + private IEnumerator TranslateScene(bool disablePlayerInput = false) { // 비동기 방식을 쓰지 않으면 씬 로드나 언로드 중에 게임이 멈출 수 있다고 함 Debug.Log("_targetScene: " + _targetScene); @@ -86,7 +86,10 @@ private IEnumerator TranslateScene() // 중간 씬 언로드 yield return SceneManager.UnloadSceneAsync(_middleScene); - Managers.Data.InGameKeyBinder.PlayerInputEnable(); + if (!disablePlayerInput) + { + Managers.Data.InGameKeyBinder.PlayerInputEnable(); + } } public void ConnectDirection() diff --git a/Assets/Scripts/Runtime/Middle/ConnectionController.cs b/Assets/Scripts/Runtime/Middle/ConnectionController.cs index 61597f0b..536cbb52 100644 --- a/Assets/Scripts/Runtime/Middle/ConnectionController.cs +++ b/Assets/Scripts/Runtime/Middle/ConnectionController.cs @@ -42,6 +42,7 @@ IEnumerator ActiveGlitch(bool isConnection) _volume.weight = 0.59f; yield return new WaitForSeconds(1f); _volume.weight = 0; + Managers.Data.InGameKeyBinder.PlayerInputEnable(); if (isConnection) {