DO-46 [Feat] 게임 결과 저장 추가

This commit is contained in:
Lim0_C 2025-03-21 17:49:24 +09:00
parent 631d2a113e
commit e5a3921013
2 changed files with 165 additions and 5 deletions

View File

@ -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}

View File

@ -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: 게임 종료 후 행동 구현
}