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

 

+ Recent posts