diff --git a/Assets/Script/Game/GameLogic.cs b/Assets/Script/Game/GameLogic.cs index 7b9f8f2..6e4a804 100644 --- a/Assets/Script/Game/GameLogic.cs +++ b/Assets/Script/Game/GameLogic.cs @@ -148,6 +148,7 @@ public partial class GameLogic : IDisposable TimerPause(); ExecuteOnMainThread(() => { + GameManager.Instance.panelManager.OpenLoadingPanel(true, true, false, false); GameManager.Instance.panelManager.OpenDrawConfirmPanel("무승부 요청을 승낙하시겠습니까?", () => { GameManager.Instance.panelManager.OpenEffectPanel(Enums.GameResult.Draw); @@ -160,32 +161,52 @@ public partial class GameLogic : IDisposable }); break; case Constants.MultiplayManagerState.DrawRequestSent: + { Debug.Log("무승부 요청 전송 완료"); + ExecuteOnMainThread(() => + { + GameManager.Instance.panelManager.OpenLoadingPanel(true, true, false, false); + }); TimerPause(); break; + } case Constants.MultiplayManagerState.DrawAccepted: Debug.Log("무승부 요청이 승낙이 들어옴"); ExecuteOnMainThread(() => { + GameManager.Instance.panelManager.CloseLoadingPanel(); GameManager.Instance.panelManager.OpenEffectPanel(Enums.GameResult.Draw); EndGame(Enums.GameResult.Draw); }); break; case Constants.MultiplayManagerState.DrawConfirmed: + { Debug.Log("무승부 요청 승낙 완료"); + ExecuteOnMainThread(() => + { + GameManager.Instance.panelManager.CloseLoadingPanel(); + }); break; + } case Constants.MultiplayManagerState.DrawRejected: Debug.Log("무승부 요청이 거부가 들어옴"); TimerUnpause(); ExecuteOnMainThread(() => { + GameManager.Instance.panelManager.CloseLoadingPanel(); GameManager.Instance.panelManager.OpenConfirmPanel("무승부 요청을 거부하였습니다.", () => { }); }); break; case Constants.MultiplayManagerState.DrawRejectionConfirmed: + { Debug.Log("무승부 요청 거부 완료"); + ExecuteOnMainThread(() => + { + GameManager.Instance.panelManager.OpenLoadingPanel(true, true, false, false); + }); TimerUnpause(); break; + } case Constants.MultiplayManagerState.ReceiveTimeout: Debug.Log("상대방이 타임 아웃 됨"); ExecuteOnMainThread(() => @@ -498,7 +519,6 @@ public partial class GameLogic : IDisposable // 기존 멀티플레이 상태 초기화 MultiPlayManager = null; _roomId = null; - GameType = Enums.GameType.SinglePlay; // 싱글 플레이 상태로 변경 InitializeSinglePlayMode(); @@ -532,6 +552,12 @@ public partial class GameLogic : IDisposable } } + // 타이머 일시정지 + private void TimerPause() => FioTimer.PauseTimer(); + + // 타이머 일시정지 해제 + private void TimerUnpause() => FioTimer.StartTimer(); + // 이전에 표시된 금수 마크 제거 private void ClearForbiddenMarks() { @@ -555,12 +581,6 @@ public partial class GameLogic : IDisposable return AI_NAMIES[index]; } - // 타이머 일시정지 - private void TimerPause() => FioTimer.PauseTimer(); - - // 타이머 일시정지 해제 - private void TimerUnpause() => FioTimer.StartTimer(); - #endregion public void ChangeGameInProgress(bool inProgress) diff --git a/Assets/Script/Game/GameUtility/GameRoutine.cs b/Assets/Script/Game/GameUtility/GameRoutine.cs index a6b26cb..fd79021 100644 --- a/Assets/Script/Game/GameUtility/GameRoutine.cs +++ b/Assets/Script/Game/GameUtility/GameRoutine.cs @@ -90,4 +90,10 @@ public partial class GameLogic ChangeGameInProgress(false); Debug.Log("GameInProgress 변경 false"); } + + public void SetLastPositioned(int row, int col) + { + _lastRow = row; + _lastCol = col; + } } \ No newline at end of file diff --git a/Assets/Script/Replay/ReplayManager.cs b/Assets/Script/Replay/ReplayManager.cs index 8b5bbc7..d716375 100644 --- a/Assets/Script/Replay/ReplayManager.cs +++ b/Assets/Script/Replay/ReplayManager.cs @@ -215,6 +215,16 @@ public class ReplayManager : Singleton { ReplayManager.Instance.PushUndoMove(targetMove); _gameLogic.RemoveStone(targetMove.columnIndex, targetMove.rowIndex); + if (_placedStoneStack.Count > 0) + { + var undoLastMove = _placedStoneStack.Peek(); + _gameLogic.StoneController.SetStoneState(Enums.StoneState.LastPositioned, undoLastMove.columnIndex, undoLastMove.rowIndex); + _gameLogic.SetLastPositioned(undoLastMove.columnIndex, undoLastMove.rowIndex); + } + else + { + _gameLogic.SetLastPositioned(-1, -1); + } } public void ReplayFirst()