Linking achievements to achievements table/trophy room

I’ve got achievements working on my 2D mobile game using IEnumerator. Does anyone have C# pointers on how to link the achievements to a separate achievements/trophy room table scene?

Once each achievement is unlocked onscreen (currently working), I want each to appear in a separate scene so that they eventually make a complete list/trophy room (which can be accessed thru currently working Options menu).

Thank you in advance for your input

Easiest way would be to use PlayerPrefs to save the data.

When they earn an achievement for dying 10 times:

PlayerPrefs.SetInt("Achievement_Dying", 1);
PlayerPrefs.Save();

When they open the trophy room:

class TrophyRoom : MonoBehaviour:
{
   public GameObject dyingTrophy;

   void Start()
   {
      if(PlayerPrefs.GetInt("Achievement_Dying", 0) == 1)
          dyingTrophy.SetActive(true);
   }
}

Thank you for the fast reply! Will try soon & update w/result

Adding onto GroZZleR’s great post above, here’s a nice clean example of simple persistent loading/saving values using PlayerPrefs:

https://pastebin.com/icJSq5zC

Useful for a relatively small number of simple values.

1 Like

Worked perfectly. Thank you very much! @kurt , much appreciated!

1 Like