For the level select, we needed to have the levels not yet reached to be inaccessible. To do this, I looked into PlayerPrefs and store a key specific to the level that unlocks the next. Once the player reaches the exit, then the key is added to player prefs and stored. In order to test the function. I used print and had a ClearPrefs() that deleted the keys. When the button was pressed without the key, a label that states the level is still locked.

No comments:
Post a Comment