Player Prefs

I am creating a game in which I am giving 10 free gems at the start of the game via Player prefs in the script and when players collide with obstacles lose 01 gems. But when the user uninstalls and reinstalls the game it resets and again 10 free gems are available to play. How can I fix it? Can anyone guide me step by step?

How about saving the data another way? Brackeys did a video on saving data as binary… and I guess it may persist after uninstalling as well…

Here’s the link to the video-

Hi All,
The above brackeys tutorial related to save/load player data is working fine. But i want to add two functionalities.

  1. how to give a free gem at the start of the game only one time without using player prefs (as I heard about player prefs that is not an efficient way to use it)? currently, I am using the below player prefs script to give free gems.
    if (!PlayerPrefs.HasKey(“init”))
    {
    PlayerPrefs.SetInt(“init”, 1);
    PlayerPrefs.SetInt(“Gem Score”, 03);
    }

  2. What if we require to call gem value in another scene? (again without player prefs because with player prefs I can easily save int value in a key and call that key in another scene script and its working fine)