From e5a3921013bcd1688f602552598aeb3db27257f9 Mon Sep 17 00:00:00 2001 From: Lim0_C Date: Fri, 21 Mar 2025 17:49:24 +0900 Subject: [PATCH 1/3] =?UTF-8?q?DO-46=20[Feat]=20=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=EA=B2=B0=EA=B3=BC=20=EC=A0=80=EC=9E=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/Game.unity | 156 ++++++++++++++++++++++++++++++++ Assets/Script/Game/GameLogic.cs | 14 ++- 2 files changed, 165 insertions(+), 5 deletions(-) diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 5b879e7..deaf64a 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -122,6 +122,103 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1001 &873369031 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 626368541760032086, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_Name + value: Canvas + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_Pivot.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6113787613246818512, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 65aac0e22fe25aa42b9cf7df776a854d, type: 3} --- !u!1 &1100315178 GameObject: m_ObjectHideFlags: 0 @@ -296,6 +393,63 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: widthUnit: 15 +--- !u!1001 &1657305406 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalPosition.y + value: 1.25 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4420653492898845705, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4920236250940775331, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} + propertyPath: m_Name + value: Omok Board Image + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 37c097f76fd13ca4fafdf2fe352b7f46, type: 3} --- !u!1 &1957136442 GameObject: m_ObjectHideFlags: 0 @@ -54393,3 +54547,5 @@ SceneRoots: - {fileID: 1100315181} - {fileID: 1957136444} - {fileID: 2953084326979075905} + - {fileID: 873369031} + - {fileID: 1657305406} diff --git a/Assets/Script/Game/GameLogic.cs b/Assets/Script/Game/GameLogic.cs index f0c2d4c..f8c0b55 100644 --- a/Assets/Script/Game/GameLogic.cs +++ b/Assets/Script/Game/GameLogic.cs @@ -20,7 +20,8 @@ public abstract class BasePlayerState if (gameLogic.CheckGameWin(playerType, row, col)) { GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {playerType} Win",() =>{}); - gameLogic.EndGame(); + var gameResult = playerType == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose; + gameLogic.EndGame(gameResult); } else { @@ -29,7 +30,7 @@ public abstract class BasePlayerState if (gameLogic.CheckGameDraw()) { GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: Draw",() =>{}); - gameLogic.EndGame(); + gameLogic.EndGame(Enums.GameResult.Draw); } else { @@ -216,13 +217,15 @@ public class GameLogic : MonoBehaviour { GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerB} Win", () =>{}); - EndGame(); + var gameResult = currentTurn == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose; + EndGame(gameResult); } else if (currentTurn == Enums.PlayerType.PlayerB) { GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerA} Win", () =>{}); - EndGame(); + var gameResult = currentTurn == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose; + EndGame(gameResult); } }; } @@ -341,9 +344,10 @@ public class GameLogic : MonoBehaviour selectedCol = -1; } //게임 끝 - public void EndGame() + public void EndGame(Enums.GameResult result) { SetState(null); + ReplayManager.Instance.SaveReplayDataResult(result); //TODO: 게임 종료 후 행동 구현 } From 8f5292c532b0cfa2777ce77ce94c7d4d9791f7cf Mon Sep 17 00:00:00 2001 From: Lim0_C Date: Fri, 21 Mar 2025 17:56:31 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Do-46=20[Fix]=20=ED=83=80=EC=9E=84=20?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=ED=98=B8=EC=B6=9C=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 승리자가 잘못 저장되는 부분을 수정 --- Assets/Script/Game/GameLogic.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Script/Game/GameLogic.cs b/Assets/Script/Game/GameLogic.cs index f8c0b55..29ffa6b 100644 --- a/Assets/Script/Game/GameLogic.cs +++ b/Assets/Script/Game/GameLogic.cs @@ -217,14 +217,14 @@ public class GameLogic : MonoBehaviour { GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerB} Win", () =>{}); - var gameResult = currentTurn == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose; + var gameResult = currentTurn == Enums.PlayerType.PlayerA? Enums.GameResult.Lose:Enums.GameResult.Win; EndGame(gameResult); } else if (currentTurn == Enums.PlayerType.PlayerB) { GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerA} Win", () =>{}); - var gameResult = currentTurn == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose; + var gameResult = currentTurn == Enums.PlayerType.PlayerB? Enums.GameResult.Win:Enums.GameResult.Lose; EndGame(gameResult); } }; From 4b1dc01c3a5454e49dad058df43274d1120f5a90 Mon Sep 17 00:00:00 2001 From: Lim0_C Date: Fri, 21 Mar 2025 18:05:48 +0900 Subject: [PATCH 3/3] =?UTF-8?q?DO-46=20[Fix]=20=ED=83=80=EC=9E=84=20?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EA=B2=B0=EA=B3=BC=EA=B0=92=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Script/Game/GameLogic.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/Script/Game/GameLogic.cs b/Assets/Script/Game/GameLogic.cs index 29ffa6b..95593f3 100644 --- a/Assets/Script/Game/GameLogic.cs +++ b/Assets/Script/Game/GameLogic.cs @@ -217,15 +217,13 @@ public class GameLogic : MonoBehaviour { GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerB} Win", () =>{}); - var gameResult = currentTurn == Enums.PlayerType.PlayerA? Enums.GameResult.Lose:Enums.GameResult.Win; - EndGame(gameResult); + EndGame(Enums.GameResult.Lose); } else if (currentTurn == Enums.PlayerType.PlayerB) { GameManager.Instance.panelManager.OpenConfirmPanel($"Game Over: {Enums.PlayerType.PlayerA} Win", () =>{}); - var gameResult = currentTurn == Enums.PlayerType.PlayerB? Enums.GameResult.Win:Enums.GameResult.Lose; - EndGame(gameResult); + EndGame(Enums.GameResult.Win); } }; }