From 8106cbd247828a824bf60572b4b8d56b2e889393 Mon Sep 17 00:00:00 2001 From: acastracity Date: Wed, 27 Nov 2024 03:23:22 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[Fix]=20=EC=8A=A4=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EC=A7=80(=EA=B0=90=EC=98=A5)=20=ED=81=B4=EB=A6=AC=EC=96=B4=20?= =?UTF-8?q?=EC=9D=B4=ED=9B=84=EC=97=90=EB=8F=84=20esc=ED=82=A4=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=BC=EC=8B=9C=EC=A0=95=EC=A7=80=20=EC=B0=BD=EC=9D=84=20?= =?UTF-8?q?=EB=9D=84=EC=9A=B8=20=EC=88=98=20=EC=9E=88=EB=8D=98=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GoalZoneScript에서 goalZone.stageClear가 false일 때만 일시정지 창 띄우는 함수가 동작하도록 했습니다. - 원인을 알 수 없지만, PrisonScene -> goalZone object -> Goal Zone Script component -> Stage Clear 란이 '체크(True)'되어 있었습니다.. 이것을 전혀 의심하지 못해 시간이 상당 소요되었습니다. --- Assets/Scenes/PrisonScene.unity | 3 ++- Assets/Script/UIManager/PrisonUIManager.cs | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Assets/Scenes/PrisonScene.unity b/Assets/Scenes/PrisonScene.unity index 80d05ad..7a17b57 100644 --- a/Assets/Scenes/PrisonScene.unity +++ b/Assets/Scenes/PrisonScene.unity @@ -646,6 +646,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: stageManager: {fileID: 33556873} + goalZone: {fileID: 0} tutorialPanel: {fileID: 2146890594} pausePanel: {fileID: 1041156427} pauseTextPanel: {fileID: 664677909} @@ -2347,7 +2348,7 @@ MonoBehaviour: player1InZone: 0 player2InZone: 0 stageManager: {fileID: 33556873} - stageClear: 1 + stageClear: 0 MapClearPanel: {fileID: 1376517036} clearTimeText: {fileID: 619571448} --- !u!61 &513861989 diff --git a/Assets/Script/UIManager/PrisonUIManager.cs b/Assets/Script/UIManager/PrisonUIManager.cs index d85593e..5ed4a98 100644 --- a/Assets/Script/UIManager/PrisonUIManager.cs +++ b/Assets/Script/UIManager/PrisonUIManager.cs @@ -8,6 +8,8 @@ public class PrisonUIManager : MonoBehaviour public StageManager stageManager; private PhotonView photonView; + public GoalZoneScript goalZone; + public GameObject tutorialPanel; public GameObject pausePanel; public GameObject pauseTextPanel; @@ -20,6 +22,7 @@ public class PrisonUIManager : MonoBehaviour private void Start() { stageManager = FindObjectOfType(); + goalZone = FindAnyObjectByType(); photonView = GetComponent(); tutorialPanel.SetActive(tutorialPanelOpen); } @@ -87,7 +90,7 @@ public void ClosePausePanel() void UpdatePauseState(int actorNumber, bool pauseState) { isPaused = pauseState; - if (pauseState) + if (!goalZone.stageClear && pauseState) { stageManager.isPaused = true; stageManager.SetPlayerMovement(false); @@ -104,7 +107,7 @@ void UpdatePauseState(int actorNumber, bool pauseState) pauseTextPanel.gameObject.SetActive(true); } } - else if (!pauseState) + else if (!goalZone.stageClear && !pauseState) { stageManager.isPaused = false; stageManager.SetPlayerMovement(true); From 92d0204553cc447887aec3eac29737b74fc4c574 Mon Sep 17 00:00:00 2001 From: acastracity Date: Wed, 27 Nov 2024 03:23:22 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[Fix]=20=EC=8A=A4=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EC=A7=80(=EA=B0=90=EC=98=A5)=20=ED=81=B4=EB=A6=AC=EC=96=B4=20?= =?UTF-8?q?=EC=9D=B4=ED=9B=84=EC=97=90=EB=8F=84=20esc=ED=82=A4=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=BC=EC=8B=9C=EC=A0=95=EC=A7=80=20=EC=B0=BD=EC=9D=84=20?= =?UTF-8?q?=EB=9D=84=EC=9A=B8=20=EC=88=98=20=EC=9E=88=EB=8D=98=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GoalZoneScript에서 goalZone.stageClear가 false일 때만 일시정지 창 띄우는 함수가 동작하도록 했습니다. - 원인을 알 수 없지만, PrisonScene -> goalZone object -> Goal Zone Script component -> Stage Clear 란이 '체크(True)'되어 있었습니다.. 이것을 전혀 의심하지 못해 시간이 상당 소요되었습니다. --- Assets/Scenes/PrisonScene.unity | 3 +- Assets/Script/UIManager/PrisonUIManager.cs | 44 ++++++++++++---------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/Assets/Scenes/PrisonScene.unity b/Assets/Scenes/PrisonScene.unity index 80d05ad..7a17b57 100644 --- a/Assets/Scenes/PrisonScene.unity +++ b/Assets/Scenes/PrisonScene.unity @@ -646,6 +646,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: stageManager: {fileID: 33556873} + goalZone: {fileID: 0} tutorialPanel: {fileID: 2146890594} pausePanel: {fileID: 1041156427} pauseTextPanel: {fileID: 664677909} @@ -2347,7 +2348,7 @@ MonoBehaviour: player1InZone: 0 player2InZone: 0 stageManager: {fileID: 33556873} - stageClear: 1 + stageClear: 0 MapClearPanel: {fileID: 1376517036} clearTimeText: {fileID: 619571448} --- !u!61 &513861989 diff --git a/Assets/Script/UIManager/PrisonUIManager.cs b/Assets/Script/UIManager/PrisonUIManager.cs index d85593e..f557c68 100644 --- a/Assets/Script/UIManager/PrisonUIManager.cs +++ b/Assets/Script/UIManager/PrisonUIManager.cs @@ -8,6 +8,8 @@ public class PrisonUIManager : MonoBehaviour public StageManager stageManager; private PhotonView photonView; + public GoalZoneScript goalZone; + public GameObject tutorialPanel; public GameObject pausePanel; public GameObject pauseTextPanel; @@ -20,6 +22,7 @@ public class PrisonUIManager : MonoBehaviour private void Start() { stageManager = FindObjectOfType(); + goalZone = FindAnyObjectByType(); photonView = GetComponent(); tutorialPanel.SetActive(tutorialPanelOpen); } @@ -86,32 +89,35 @@ public void ClosePausePanel() [PunRPC] void UpdatePauseState(int actorNumber, bool pauseState) { - isPaused = pauseState; - if (pauseState) + if (!goalZone.stageClear) { - stageManager.isPaused = true; - stageManager.SetPlayerMovement(false); - pausedByPlayerId = actorNumber; - - if (PhotonNetwork.LocalPlayer.ActorNumber == actorNumber) + isPaused = pauseState; + if (pauseState) { - pausePanel.gameObject.SetActive(true); - pauseTextPanel.gameObject.SetActive(false); + stageManager.isPaused = true; + stageManager.SetPlayerMovement(false); + pausedByPlayerId = actorNumber; + + if (PhotonNetwork.LocalPlayer.ActorNumber == actorNumber) + { + pausePanel.gameObject.SetActive(true); + pauseTextPanel.gameObject.SetActive(false); + } + else + { + pausePanel.gameObject.SetActive(false); + pauseTextPanel.gameObject.SetActive(true); + } } - else + else if (!pauseState) { + stageManager.isPaused = false; + stageManager.SetPlayerMovement(true); + pausedByPlayerId = -1; pausePanel.gameObject.SetActive(false); - pauseTextPanel.gameObject.SetActive(true); + pauseTextPanel.gameObject.SetActive(false); } } - else if (!pauseState) - { - stageManager.isPaused = false; - stageManager.SetPlayerMovement(true); - pausedByPlayerId = -1; - pausePanel.gameObject.SetActive(false); - pauseTextPanel.gameObject.SetActive(false); - } } From 8ad88959f6d571fb1220244ba0baf62f2a91090c Mon Sep 17 00:00:00 2001 From: Do Hyeon Seok Date: Wed, 27 Nov 2024 04:51:09 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[Fix]=20PrisonUIManager=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20RoomUIManager=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 왜 달았지..? 정말 이유를 모르겠습니다. --- Assets/Scenes/RoomScene.unity | 22 +--------------------- Assets/Script/UIManager/PrisonUIManager.cs | 1 - 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/Assets/Scenes/RoomScene.unity b/Assets/Scenes/RoomScene.unity index e44df20..403e514 100644 --- a/Assets/Scenes/RoomScene.unity +++ b/Assets/Scenes/RoomScene.unity @@ -2516,7 +2516,6 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 2031633106} - - component: {fileID: 2031633105} m_Layer: 0 m_Name: RoomUIManager m_TagString: Untagged @@ -2524,26 +2523,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &2031633105 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2031633104} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0f76658be6961f941815513e93e7639f, type: 3} - m_Name: - m_EditorClassIdentifier: - tutorialPanel: {fileID: 0} - pausePanel: {fileID: 0} - titleExitPanel: {fileID: 0} - roomCodeInputPanel: {fileID: 0} - tutorialPanelOpen: 1 - titleExitPanelOpen: 0 - roomCodeInputPanelOpen: 0 - pause: 0 --- !u!4 &2031633106 Transform: m_ObjectHideFlags: 0 @@ -2567,3 +2546,4 @@ SceneRoots: - {fileID: 1222379148} - {fileID: 1276365108} - {fileID: 1710354787} + - {fileID: 2031633106} diff --git a/Assets/Script/UIManager/PrisonUIManager.cs b/Assets/Script/UIManager/PrisonUIManager.cs index 36bebec..dc5b2af 100644 --- a/Assets/Script/UIManager/PrisonUIManager.cs +++ b/Assets/Script/UIManager/PrisonUIManager.cs @@ -1,5 +1,4 @@ using UnityEngine; -using UnityEngine.SceneManagement; using Photon.Pun; using System.Collections; From fd0d6d6a11026a78e458c4a4baa8f91d88ea8b4d Mon Sep 17 00:00:00 2001 From: acastracity Date: Wed, 27 Nov 2024 05:20:27 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[Fix]=20=EC=8A=A4=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EC=A7=80(=EA=B0=90=EC=98=A5)=20=ED=81=B4=EB=A6=AC=EC=96=B4=20?= =?UTF-8?q?=EC=9D=B4=ED=9B=84=EC=97=90=EB=8F=84=20esc=ED=82=A4=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=BC=EC=8B=9C=EC=A0=95=EC=A7=80=20=EC=B0=BD=EC=9D=84=20?= =?UTF-8?q?=EB=9D=84=EC=9A=B8=20=EC=88=98=20=EC=9E=88=EB=8D=98=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GoalZoneScript에서 goalZone.stageClear가 false일 때만 일시정지 창 띄우는 함수가 동작하도록 했습니다. - 원인을 알 수 없지만, PrisonScene -> goalZone object -> Goal Zone Script component -> Stage Clear 란이 '체크(True)'되어 있었습니다.. 이것을 전혀 의심하지 못해 시간이 상당 소요되었습니다. --- Assets/Script/UIManager/PrisonUIManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Script/UIManager/PrisonUIManager.cs b/Assets/Script/UIManager/PrisonUIManager.cs index f4cb054..ed77612 100644 --- a/Assets/Script/UIManager/PrisonUIManager.cs +++ b/Assets/Script/UIManager/PrisonUIManager.cs @@ -97,6 +97,8 @@ public void ClosePausePanel() [PunRPC] void UpdatePauseState(int actorNumber, bool pauseState) { + if (!goalZone.stageClear) + { isPaused = pauseState; PauseManager.Instance.isPaused = pauseState; if (pauseState) @@ -125,6 +127,7 @@ void UpdatePauseState(int actorNumber, bool pauseState) pauseTextPanel.gameObject.SetActive(false); } StartCoroutine(ResetTransitionState()); + } } private IEnumerator ResetTransitionState() From 860b1c10def7a630c07f62cdb9024d74dd3c51fb Mon Sep 17 00:00:00 2001 From: acastracity Date: Wed, 27 Nov 2024 06:12:50 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[Fix]=20=ED=94=8C=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=96=B4=EA=B0=80=20=EC=9D=B4=EB=8F=99=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=EC=97=90=EC=84=9C=20=EC=9D=BC=EC=8B=9C?= =?UTF-8?q?=EC=A0=95=EC=A7=80=ED=95=98=EB=A9=B4,=20=EC=9D=B4=EB=8F=99?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EB=B0=A9=ED=96=A5=20=EA=B7=B8=EB=8C=80?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=84=EC=A7=84=ED=95=98=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 플레이어가 방향 키를 누른 상태에서 esc 버튼을 누르면, 일시 정지 상태에서도 해당 방향으로 이동하던 문제를 해결했습니다. - 일시 정지 상태에서 이동 속도를 0으로 조정했습니다. - 애니메이션은 속도가 0인 것처럼 표현하도록 하였으나, 일시 정지 상태에서는 화면이 가려지므로 당장 의미는 없습니다. --- Assets/Script/PlayerManager.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Assets/Script/PlayerManager.cs b/Assets/Script/PlayerManager.cs index 8290760..2c93545 100644 --- a/Assets/Script/PlayerManager.cs +++ b/Assets/Script/PlayerManager.cs @@ -59,10 +59,17 @@ void Start() void Update() { // 원격 플레이어일 경우 위치 및 방향 데이터를 수신하지 않음 - if(!photonView.IsMine || !canMove) + if(!photonView.IsMine) { return; } + // 움직일 수 없는 상태일 때, 애니메이션 속도 0으로 초기화 + if(!canMove) + { + inputVec = Vector2.zero; + anim.SetFloat("Speed", 0); + return; + } inputVec.x = Input.GetAxisRaw("Player1HorizontalKey"); inputVec.y = Input.GetAxisRaw("Player1VerticalKey"); @@ -88,6 +95,13 @@ void FixedUpdate() { if (!photonView.IsMine) return; + // 움직일 수 없는 상태일 때, 이동속도를 0으로 초기화 + if (!canMove) + { + rigid.velocity = Vector2.zero; + return; + } + Vector2 nextVec = inputVec.normalized * speed * Time.fixedDeltaTime; rigid.MovePosition(rigid.position + nextVec); } From 729725eded78ab32c537d1ddef84691ff55db70d Mon Sep 17 00:00:00 2001 From: acastracity Date: Thu, 28 Nov 2024 16:06:13 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[Fix]=20=EC=97=90=EB=9F=AC=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 닫는 괄호 하나를 빼먹어 에러 난 것을 수정했습니다. --- Assets/Script/UIManager/PrisonUIManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/Script/UIManager/PrisonUIManager.cs b/Assets/Script/UIManager/PrisonUIManager.cs index 8f7ab11..31d907e 100644 --- a/Assets/Script/UIManager/PrisonUIManager.cs +++ b/Assets/Script/UIManager/PrisonUIManager.cs @@ -127,6 +127,7 @@ void UpdatePauseState(int actorNumber, bool pauseState) pauseTextPanel.gameObject.SetActive(false); } StartCoroutine(ResetTransitionState()); + } } private IEnumerator ResetTransitionState() {