Skip to content

Commit

Permalink
Rollback: SceneTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
wooyn730 committed Oct 31, 2024
1 parent 7daf121 commit ccf80a8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Assets/Scripts/Runtime/CH1/Pacmom/PMEnding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void ExitPacmom()
_postProcessing.gameObject.SetActive(false);

_sceneTransform = FindObjectOfType<SceneTransform>();
_sceneTransform.EscapeFromScene("CH1");
_sceneTransform.EscapeFromScene("CH1", true);
}
}
}
15 changes: 9 additions & 6 deletions Assets/Scripts/Runtime/ETC/SceneTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ 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();

Managers.Sound.StopAllSound();

_middleScene = _escapeScene;
_targetScene = targetScene;
StartCoroutine(nameof(TranslateScene));
StartCoroutine(nameof(TranslateScene), disablePlayerInput);
}

private IEnumerator TranslateScene()
private IEnumerator TranslateScene(bool disablePlayerInput = false)
{
// 비동기 방식을 쓰지 않으면 씬 로드나 언로드 중에 게임이 멈출 수 있다고 함
Debug.Log("_targetScene: " + _targetScene);
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Runtime/Middle/ConnectionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit ccf80a8

Please sign in to comment.