feat: 게임 플레이 화면에서 벗어나면 정보 초기화

This commit is contained in:
aube.lee
2025-02-28 15:03:10 +09:00
parent 88d14f54b4
commit 608abcbac2
3 changed files with 12 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ namespace TON
public float PlayTime => Time.time - stageStartTime;
public int goldReward { get; private set; } = 0; // 골드 획득 보상
public int expReward { get; private set; } = 0; // 경험치 획득 보상
public int waveCount { get; private set; } // 클리어한 웨이브 넘버
public int waveCount { get; private set; } = 0; // 클리어한 웨이브 넘버
public int gameScore { get; private set; } = 0; // 몬스터 처치로 얻은 점수 보상
private float stageStartTime; // 스테이지 시작 시간
@@ -79,6 +79,12 @@ namespace TON
});
}
public void ResetPlayData()
{
waveCount = 0;
goldReward = 0;
expReward = 0;
gameScore = 0;
}
}
}

View File

@@ -72,6 +72,8 @@ namespace TON
// UIManager.Hide<GameoverUI>(UIList.GameOverUI);
UIManager.Hide<PauseUI>(UIList.PauseUI);
// 스테이지 종료 후 플레이한 데이터 초기화
StageManager.Singleton.ResetPlayData();
}
}

View File

@@ -180,8 +180,9 @@ namespace TON
Debug.Log("OnClickAdButton::: ");
PlayerDataManager.Singleton.AddGold(goldAmount);
OnClickHomeButton();
goldAmount = 0;
OnClickHomeButton();
}
}