PlayerPrefs are easy to implement and i think it can be used to store important game data like selected character and coins and completed quests for small games, but i have read too much to make me ask this question that why not use it, and what is the other options for storing important game data in
As implied by the name, PlayerPrefs is mostly intended for storing config options. But it can also be abused to store savegame data, if that data is rather small. If you target platforms without write-access to a filesystem (like WebGL) then it might in fact be your only option to persist data without relying on external online services.
However, if your game data gets larger, then you soon hit some limitations:
- Some of the platform-dependent methods it uses to store data are not designed to hold large amounts of data (like the Windows registry)
- There is no elegant way to store binary data or arrays. You either have to encode them as strings, or store a bunch of uniquely named Float or Int values (and in that case the keys will take up more space than the values, so it will be very inefficient).
- PlayerPref's loading and saving is all-or-nothing. You can not load a single savegame, you have to load them all.
- It is difficult for players to exchange savegames as files, especially between different platforms.
So if you plan to add savegames to your game and the game state which needs to be saved is more than just a hand full of numbers, then you might want to consider to create real savegame files on the filesystem in a format of your design which you read and write with the standard .NET classes for file access.
Also, if you have something which the player must not be allowed to modify (like ingame items bought through microtransactions or player progression in a multiplayer game), then you generally don't want to store those on the end-user device at all. In that case you won't get around setting up an online service which manages that data.
Another thing is that Player Prefs can be easily hacked, so if you don't want a gamer to hack into them and unlock an awesome character, you should avoid using it for that kind of memory.