diff --git a/Assets/Script/Game/GameLogic.cs b/Assets/Script/Game/GameLogic.cs index 95593f3..938f5b2 100644 --- a/Assets/Script/Game/GameLogic.cs +++ b/Assets/Script/Game/GameLogic.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; public abstract class BasePlayerState { @@ -19,9 +20,11 @@ public abstract class BasePlayerState if (gameLogic.CheckGameWin(playerType, row, col)) { - GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {playerType} Win",() =>{}); - var gameResult = playerType == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose; - gameLogic.EndGame(gameResult); + GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {playerType} Win", () => + { + var gameResult = playerType == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose; + gameLogic.EndGame(gameResult); + }); } else { @@ -29,8 +32,10 @@ public abstract class BasePlayerState { if (gameLogic.CheckGameDraw()) { - GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: Draw",() =>{}); - gameLogic.EndGame(Enums.GameResult.Draw); + GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: Draw", () => + { + gameLogic.EndGame(Enums.GameResult.Draw); + }); } else { @@ -347,6 +352,7 @@ public class GameLogic : MonoBehaviour SetState(null); ReplayManager.Instance.SaveReplayDataResult(result); //TODO: 게임 종료 후 행동 구현 + SceneManager.LoadScene("Main"); } //승리 확인 함수 diff --git a/Assets/Script/Game/GameManager.cs b/Assets/Script/Game/GameManager.cs index ef4749a..e6c19df 100644 --- a/Assets/Script/Game/GameManager.cs +++ b/Assets/Script/Game/GameManager.cs @@ -38,8 +38,14 @@ public class GameManager : Singleton private void InitPanels() { - panelManager = Instantiate(panelManagerPrefab).GetComponent(); - audioManager = Instantiate(audioManagerPrefab).GetComponent(); + if (panelManager == null) + { + panelManager = Instantiate(panelManagerPrefab).GetComponent(); + } + if (audioManager == null) + { + audioManager = Instantiate(audioManagerPrefab).GetComponent(); + } } public void OnClickConfirmButton() diff --git a/Assets/Script/Main/MainPanelManager.cs b/Assets/Script/Main/MainPanelManager.cs index 94cd0bd..29b2ea6 100644 --- a/Assets/Script/Main/MainPanelManager.cs +++ b/Assets/Script/Main/MainPanelManager.cs @@ -42,7 +42,7 @@ public class MainPanelManager : MonoBehaviour UpdateMainPanelUI(GameManager.Instance.panelManager.OpenMainPanel); // ScoreData.SetScore(userInfo.score); - GameManager.Instance.panelManager.OpenConfirmPanel(userInfo.nickname + "님" + "\n" + "자동 로그인 되었습니다", () => { }); + // GameManager.Instance.panelManager.OpenConfirmPanel(userInfo.nickname + "님" + "\n" + "자동 로그인 되었습니다", () => { }); loadingPanelController.StopLoading(); }, () =>