diff --git a/Assets/JAY/Main-Jay.unity b/Assets/JAY/Main-Jay.unity index 9a49fe8..e034f2f 100644 --- a/Assets/JAY/Main-Jay.unity +++ b/Assets/JAY/Main-Jay.unity @@ -170,7 +170,7 @@ MonoBehaviour: signinPanel: {fileID: 925522282249935710, guid: e14c9b2925f0ddb4192af743e5cc166a, type: 3} signupPanel: {fileID: 3181524094944658765, guid: 8827fe7caa3145e40b1369cc42f8697d, type: 3} settingsPanel: {fileID: 0} - confirmPanel: {fileID: 0} + confirmPanel: {fileID: 8145365568262946399, guid: 76f1fe6b5243faf4f9b8caee7312d336, type: 3} rankingPanel: {fileID: 0} shopPanel: {fileID: 0} giboPanel: {fileID: 0} diff --git a/Assets/Script/Game/GameLogic.cs b/Assets/Script/Game/GameLogic.cs index 9d988e1..cc1e2ac 100644 --- a/Assets/Script/Game/GameLogic.cs +++ b/Assets/Script/Game/GameLogic.cs @@ -170,22 +170,7 @@ public class GameLogic : MonoBehaviour { this.fioTimer = fioTimer; this.fioTimer.InitTimer(); - //timer 시간초과시 진행 함수 - this.fioTimer.OnTimeout = () => - { - if (currentTurn == Enums.PlayerType.PlayerA) - { - GameManager.Instance.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerB} Win", - () =>{}); - EndGame(); - } - else if (currentTurn == Enums.PlayerType.PlayerB) - { - GameManager.Instance.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerA} Win", - () =>{}); - EndGame(); - } - }; + this.fioTimer.OnTimeout = OnTimeout; } //TODO: 기보 매니저에게 플레이어 닉네임 넘겨주기 @@ -206,6 +191,24 @@ public class GameLogic : MonoBehaviour break; } } + + //타임아웃 시 할 행동 + private void OnTimeout() + { + if (currentTurn == Enums.PlayerType.PlayerA) + { + GameManager.Instance.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerB} Win", + () =>{}); + EndGame(); + } + else if (currentTurn == Enums.PlayerType.PlayerB) + { + GameManager.Instance.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerA} Win", + () =>{}); + EndGame(); + } + } + //착수 버튼 클릭시 호출되는 함수 public void OnConfirm() { @@ -298,7 +301,7 @@ public class GameLogic : MonoBehaviour public void EndGame() { SetState(null); - + ReplayManager.Instance.SaveReplayData(currentTurn); } //승리 확인 함수 diff --git a/Assets/Script/Game/GameManager.cs b/Assets/Script/Game/GameManager.cs index 55a4b82..fc4876c 100644 --- a/Assets/Script/Game/GameManager.cs +++ b/Assets/Script/Game/GameManager.cs @@ -49,11 +49,11 @@ public class GameManager : Singleton // TryAutoSignin(); //게임 씬에서 확인하기 위한 임시 코드 - _canvas = canvas.GetComponent(); - _stoneController = GameObject.FindObjectOfType(); - _stoneController.InitStones(); - var fioTimer = FindObjectOfType(); - _gameLogic = new GameLogic(_stoneController, _gameType, fioTimer); + // _canvas = canvas.GetComponent(); + // _stoneController = GameObject.FindObjectOfType(); + // _stoneController.InitStones(); + // var fioTimer = FindObjectOfType(); + // _gameLogic = new GameLogic(_stoneController, _gameType, fioTimer); } private void TryAutoSignin()