feat: 캐릭터 사망 시 게임오버된 정보 저장하도록 로직 추가

This commit is contained in:
aube.lee
2025-02-20 15:06:27 +09:00
parent 387f446aec
commit dfd09e449f
2 changed files with 15 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ namespace TON
private void ShowGameOverUI() private void ShowGameOverUI()
{ {
UIManager.Show<GameoverUI>(UIList.GameOverUI); UIManager.Show<GameoverUI>(UIList.GameOverUI);
StageManager.Singleton.StageGameOver();
} }
} }

View File

@@ -88,8 +88,9 @@ namespace TON
return 1; return 1;
} }
public void StageClear(string characterId) public void StageClear()
{ {
string characterId = PlayerDataManager.Singleton.player.id;
float clearTime = Time.time - stageStartTime; float clearTime = Time.time - stageStartTime;
int starCount = GetStarCount(clearTime); int starCount = GetStarCount(clearTime);
Debug.Log($"스테이지 클리어! 별 개수: {starCount}"); Debug.Log($"스테이지 클리어! 별 개수: {starCount}");
@@ -100,5 +101,17 @@ namespace TON
SaveStageClearData(); SaveStageClearData();
} }
public void StageGameOver()
{
string characterId = PlayerDataManager.Singleton.player.id;
float clearTime = Time.time - stageStartTime;
int starCount = -1;
// UI 업데이트, 데이터 저장 로직 추가
StageClearData stageClearData = new StageClearData(characterId, stageId, clearTime, starCount);
stageClearDatas.Add(stageClearData);
SaveStageClearData();
}
} }
} }