public void AddLeaderboard(int score)
{
PlayGamesPlatform.Instance.ReportScore(score, GPGSIds.leaderboard_highscore, (bool success) =>
{
if (success)
{
Debug.Log("리더보드에 점수가 성공적으로 추가되었습니다.");
}
else
{
Debug.Log("리더보드 점수 추가에 실패했습니다.");
}
});
}
IEnumerator CoStart()
{
Debug.Log("몬스터가 클릭됨");
anim.SetTrigger("Hit");
hp--;
currentScore++;
Debug.Log(currentScore);
UpdateScoreText();
if (hp <= 0)
{
anim.SetBool("Die", true);
monster.interactable = false;
restartBtn.gameObject.SetActive(true);
// 게임 종료 시 클릭 횟수 PlayerPrefs에 저장
PlayerPrefs.SetInt(PlayerPrefsKey, currentScore);
PlayerPrefs.Save();
GPGSManager.Instance.AddLeaderboard(currentScore);
GPGSManager.Instance.ShowLeaderBoard();
}
yield return null;
}
'산대특' 카테고리의 다른 글
[애드몹] 배너 광고 붙이기 (0) | 2024.06.28 |
---|---|
2D 3Matchpuzzle - 매치 시 파괴 및 로드 + 힌트 (0) | 2024.05.20 |
2D 3Matchpuzzle - 블록 위치 찾기 테스트 (0) | 2024.05.16 |
2D 3Matchpuzzle - 빈공간 찾기 (0) | 2024.05.14 |
Download Python (0) | 2024.05.08 |