Accomplishments in each Level not Saving

Say you make a game where in each level there are 3 things to do, aside from finishing the level. for example: One is to finish the level without being hit, the other to collect an item, and the last to finish the level in a certain amount of time.

You get badges for these accomplishments, and see them displayed at the end of that particular level. The next level offers the same tasks (minor tweaks in the editor and inspector. That part is already set up).

How does one complete the 3 tasks on level 1, and only see what was completed on that level, and then progress to the second level where he or she only sees what was accomplished in the second level? It is essential that player be able to leave level one, and return to see what has and hasn’t been accomplished. Currently, they are not saved.

My researched has pointed fingers at XML, arrayPrefs2, GetInstanceID, DontDestroyOnLoad, and many other things. All of which I’m not particularly sure of how to tackle for my intentions, but could very well be the key to getting it done. How would you?

I’d probably save it in a specific PlayerPref file by doing something like (this is just an example to give you an idea):

PlayerPrefs.SetFloat("Level " + Application.loadedLevel.ToString(), pointsAcquired);

Then, when you want to load those points, just do:

PlayerPrefs.GetFloat("Level //That level number//");

You might do some extra research about player prefs on the wiki. (I’m really no expert my self!)

On the other hand, one thing worth noting is that PlayerPrefs is not really a ‘secure’ code. It’s easily editable by the player if he knows what he’s doing. But if that’s just a single player game with no online-score-sharing thing, players are only going to ruin their own fun by doing so.

I hope I at least somewhat helped :slight_smile:

Well, I think that you should take a look on the arrayPrefs2. That’s, in my opinion, the best way to handle your demand.
You have no alternative, it seems, if not keep the badges accomplishments recorded, so, I’d definitively go with that approach.