diff --git a/Assets/Scenes/PrisonScene.unity b/Assets/Scenes/PrisonScene.unity index acab31d..a5ab285 100644 --- a/Assets/Scenes/PrisonScene.unity +++ b/Assets/Scenes/PrisonScene.unity @@ -790,6 +790,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: stageManager: {fileID: 33556873} + goalZone: {fileID: 0} tutorialPanel: {fileID: 2146890594} pausePanel: {fileID: 1041156427} pauseTextPanel: {fileID: 664677909} @@ -2291,7 +2292,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/Scenes/RoomScene.unity b/Assets/Scenes/RoomScene.unity index f2eeca9..5c62e0c 100644 --- a/Assets/Scenes/RoomScene.unity +++ b/Assets/Scenes/RoomScene.unity @@ -2693,6 +2693,37 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1956269872} m_CullTransparentMesh: 1 +--- !u!1 &2031633104 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2031633106} + m_Layer: 0 + m_Name: RoomUIManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2031633106 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2031633104} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 921.40106, y: 445.11484, z: -6.1936984} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/Script/PlayerManager.cs b/Assets/Script/PlayerManager.cs index f3119bc..15ff7b8 100644 --- a/Assets/Script/PlayerManager.cs +++ b/Assets/Script/PlayerManager.cs @@ -69,10 +69,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"); @@ -96,6 +103,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); } diff --git a/Assets/Script/UIManager/PrisonUIManager.cs b/Assets/Script/UIManager/PrisonUIManager.cs index 26aaed2..17ae312 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; @@ -8,6 +7,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 +21,7 @@ public class PrisonUIManager : MonoBehaviour private void Start() { stageManager = FindObjectOfType(); + goalZone = FindAnyObjectByType(); photonView = GetComponent(); tutorialPanel.SetActive(tutorialPanelOpen); } @@ -79,7 +81,10 @@ public void ClosePausePanel() [PunRPC] void UpdatePauseState(int actorNumber, bool pauseState) { + if (!goalZone.stageClear) + { isPaused = pauseState; + if (!goalZone.stageClear && pauseState) PauseManager.Instance.isPaused = pauseState; if (pauseState) { @@ -107,7 +112,7 @@ void UpdatePauseState(int actorNumber, bool pauseState) pauseTextPanel.gameObject.SetActive(false); } StartCoroutine(ResetTransitionState()); - + } } private IEnumerator ResetTransitionState() {